Skip to content

Commit d20c877

Browse files
committed
Add an ssl_verification option (more below)
This can be: - bool (True): always check - bool (False): never check) - str: (check certificate at specified path)
1 parent 06d8665 commit d20c877

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plotly/tools.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def warning_on_one_line(message, category, filename, lineno, file=None, line=Non
5050
'stream_ids': []},
5151
CONFIG_FILE: {'plotly_domain': 'https://plot.ly',
5252
'plotly_streaming_domain': 'stream.plot.ly',
53-
'plotly_api_domain': 'https://api.plot.ly'}}
53+
'plotly_api_domain': 'https://api.plot.ly',
54+
'plotly_ssl_verification': True}}
5455

5556
try:
5657
os.mkdir(TEST_DIR)
@@ -142,7 +143,8 @@ def reset_credentials_file():
142143

143144
def set_config_file(plotly_domain=None,
144145
plotly_streaming_domain=None,
145-
plotly_api_domain=None):
146+
plotly_api_domain=None,
147+
plotly_ssl_verification=None):
146148
"""Set the keyword-value pairs in `~/.plotly/.config`.
147149
148150
"""
@@ -157,6 +159,8 @@ def set_config_file(plotly_domain=None,
157159
settings['plotly_streaming_domain'] = plotly_streaming_domain
158160
if isinstance(plotly_api_domain, six.string_types):
159161
settings['plotly_api_domain'] = plotly_api_domain
162+
if isinstance(plotly_ssl_verification, (six.string_types, bool)):
163+
settings['plotly_ssl_verification'] = plotly_ssl_verification
160164
utils.save_json_dict(CONFIG_FILE, settings)
161165
ensure_local_plotly_files() # make sure what we just put there is OK
162166

0 commit comments

Comments
 (0)