Skip to content
This repository was archived by the owner on Dec 27, 2018. It is now read-only.

SSL Certificate verification #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion PythonConfluenceAPI/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ConfluenceAPI(object):
ATTACHMENT_METADATA_KEYS = {"id", "type", "version", "title"}
UPDATE_CONTENT_REQUIRED_KEYS = {"id", "version"}

def __init__(self, username, password, uri_base, user_agent=DEFAULT_USER_AGENT):
def __init__(self, username, password, uri_base, user_agent=DEFAULT_USER_AGENT, verifyCert=true):
"""
Initialize the API object.
:param username: Your Confluence username.
Expand All @@ -73,6 +73,7 @@ def __init__(self, username, password, uri_base, user_agent=DEFAULT_USER_AGENT):
self.uri_base = uri_base if uri_base.endswith('/') else uri_base + "/"
self.user_agent = user_agent
self.session = None
self.verifyCert = verifyCert

def _start_http_session(self):
"""
Expand All @@ -81,6 +82,8 @@ def _start_http_session(self):
"""
api_logger.debug("Starting new HTTP session...")
self.session = requests.Session()
if self.verifyCert == False
self.session.verify = False
self.session.headers.update({"User-Agent": self.user_agent})
if self.username and self.password:
api_logger.debug("Requests will use authorization.")
Expand Down