Skip to content
Snippets Groups Projects
Commit 43076e5e authored by Rajesh's avatar Rajesh
Browse files

Certs module initial checkin

parent 145f1ba5
No related branches found
No related tags found
No related merge requests found
# 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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment