Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael William Coughlin
GraceDB Server
Commits
863b4360
Verified
Commit
863b4360
authored
6 years ago
by
Tanner Prestegard
Browse files
Options
Downloads
Patches
Plain Diff
Generalizing CA path for certificate verification to settings
parent
a2e2470d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/settings/base.py
+3
-0
3 additions, 0 deletions
config/settings/base.py
gracedb/api/backends.py
+2
-4
2 additions, 4 deletions
gracedb/api/backends.py
with
5 additions
and
4 deletions
config/settings/base.py
+
3
−
0
View file @
863b4360
...
...
@@ -274,6 +274,9 @@ X509_ISSUER_DN_HEADER = 'HTTP_SSL_CLIENT_I_DN'
X509_CERT_HEADER
=
'
HTTP_X_FORWARDED_TLS_CLIENT_CERT
'
X509_INFOS_HEADER
=
'
HTTP_X_FORWARDED_TLS_CLIENT_CERT_INFOS
'
# Path to CA store for X509 certificate verification
CAPATH
=
'
/etc/grid-security/certificates
'
# List of authentication backends to use when attempting to authenticate
# a user. Will be used in this order. Authentication for the API is
# handled by the REST_FRAMEWORK dictionary.
...
...
This diff is collapsed.
Click to expand it.
gracedb/api/backends.py
+
2
−
4
View file @
863b4360
...
...
@@ -249,16 +249,14 @@ class GraceDbX509FullCertAuthentication(GraceDbX509Authentication):
return
cert_der
def
verify_certificate_chain
(
self
,
cert_data
,
trusted_certs
=
'
/etc/grid-security/certificates
'
):
def
verify_certificate_chain
(
self
,
cert_data
,
capath
=
settings
.
CAPATH
):
# Load certificate data
certificate
=
OpenSSL
.
crypto
.
load_certificate
(
OpenSSL
.
crypto
.
FILETYPE_ASN1
,
cert_data
)
# Set up context and get certificate store
ctx
=
OpenSSL
.
SSL
.
Context
(
OpenSSL
.
SSL
.
TLSv1_METHOD
)
ctx
.
load_verify_locations
(
None
,
capath
=
trusted_certs
)
ctx
.
load_verify_locations
(
None
,
capath
=
capath
)
store
=
ctx
.
get_cert_store
()
# Verify certificate
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment