Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
devops
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
osm
devops
Commits
43076e5e
Commit
43076e5e
authored
8 years ago
by
Rajesh
Browse files
Options
Downloads
Patches
Plain Diff
Certs module initial checkin
parent
145f1ba5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/certs.py
+32
-0
32 additions, 0 deletions
test/certs.py
with
32 additions
and
0 deletions
test/certs.py
0 → 100644
+
32
−
0
View file @
43076e5e
# RIFT_IO_STANDARD_CMAKE_COPYRIGHT_HEADER(BEGIN)
# Creation Date: 2/5/16
# RIFT_IO_STANDARD_CMAKE_COPYRIGHT_HEADER(END)
import
os
class
BootstrapSslMissingException
(
Exception
):
pass
# True if the environment variable is unset, otherwise False
USE_SSL
=
os
.
environ
.
get
(
"
RIFT_BOOT_WITHOUT_HTTPS
"
,
None
)
is
None
def
get_bootstrap_cert_and_key
():
'''
Lookup the bootstrap certificate and key and return their paths
'''
user_cert
=
os
.
path
.
join
(
"
/
"
,
"
etc
"
,
"
ssl
"
,
"
current.cert
"
)
user_key
=
os
.
path
.
join
(
"
/
"
,
"
etc
"
,
"
ssl
"
,
"
current.key
"
)
if
os
.
path
.
isfile
(
user_cert
)
and
os
.
path
.
isfile
(
user_key
):
return
USE_SSL
,
user_cert
,
user_key
rift_install
=
os
.
environ
[
"
RIFT_INSTALL
"
]
rift_cert
=
os
.
path
.
join
(
rift_install
,
"
etc
"
,
"
ssl
"
,
"
current.cert
"
)
rift_key
=
os
.
path
.
join
(
rift_install
,
"
etc
"
,
"
ssl
"
,
"
current.key
"
)
if
os
.
path
.
isfile
(
rift_cert
)
and
os
.
path
.
isfile
(
rift_key
):
return
USE_SSL
,
rift_cert
,
rift_key
raise
BootstrapSslMissingException
()
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