Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
G
gracedb-client
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Leo Pound Singer
gracedb-client
Commits
da247e04
Verified
Commit
da247e04
authored
Nov 07, 2018
by
Tanner Prestegard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ability to use cheap certs for test hosts
parent
ae941b7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
19 deletions
+9
-19
ligo/gracedb/rest.py
ligo/gracedb/rest.py
+9
-19
No files found.
ligo/gracedb/rest.py
View file @
da247e04
...
...
@@ -35,7 +35,6 @@ from .utils import event_or_superevent, handle_str_or_list_arg, safe_netrc, \
cleanListInput
,
get_dt_from_openssl_output
,
is_expired
DEFAULT_SERVICE_URL
=
"https://gracedb.ligo.org/api/"
KNOWN_TEST_HOSTS
=
[
'moe.phys.uwm.edu'
,
'embb-dev.ligo.caltech.edu'
,
'simdb.phys.uwm.edu'
,]
#---------------------------------------------------------------------
# This monkey patch forces TLSv1 if the python version is 2.6.6.
...
...
@@ -162,15 +161,11 @@ class GsiRest(object):
msg
+=
"Please run ligo-proxy-init or grid-proxy-init again "
msg
+=
"or make sure your robot certificate is readable.
\n\n
"
self
.
output_and_die
(
msg
)
# Generally speaking, test boxes use cheap/free certs from the LIGO CA.
# These cannot be verified by the client.
if
host
in
KNOWN_TEST_HOSTS
:
ssl_context
.
verify_mode
=
ssl
.
CERT_NONE
else
:
ssl_context
.
verify_mode
=
ssl
.
CERT_REQUIRED
ssl_context
.
check_hostname
=
True
# Find the various CA cert bundles stored on the system
ssl_context
.
load_default_certs
()
# Load and verify certificates
ssl_context
.
verify_mode
=
ssl
.
CERT_REQUIRED
ssl_context
.
check_hostname
=
True
# Find the various CA cert bundles stored on the system
ssl_context
.
load_default_certs
()
if
proxy_host
:
self
.
connector
=
lambda
:
ProxyHTTPSConnection
(
proxy_host
,
proxy_port
,
context
=
ssl_context
)
...
...
@@ -2033,15 +2028,10 @@ class GraceDbBasic(GraceDb):
# Use the new method with SSL Context
# Prepare SSL context
ssl_context
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
# Generally speaking, test boxes use cheap/free certs from the LIGO CA.
# These cannot be verified by the client.
if
host
in
KNOWN_TEST_HOSTS
:
ssl_context
.
verify_mode
=
ssl
.
CERT_NONE
else
:
ssl_context
.
verify_mode
=
ssl
.
CERT_REQUIRED
ssl_context
.
check_hostname
=
True
# Find the various CA cert bundles stored on the system
ssl_context
.
load_default_certs
()
ssl_context
.
verify_mode
=
ssl
.
CERT_REQUIRED
ssl_context
.
check_hostname
=
True
# Find the various CA cert bundles stored on the system
ssl_context
.
load_default_certs
()
if
proxy_host
:
self
.
connector
=
lambda
:
ProxyHTTPSConnection
(
proxy_host
,
proxy_port
,
context
=
ssl_context
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment