1 # RIFT_IO_STANDARD_CMAKE_COPYRIGHT_HEADER(BEGIN)
2 # Creation Date: 2/5/16
3 # RIFT_IO_STANDARD_CMAKE_COPYRIGHT_HEADER(END)
7 class BootstrapSslMissingException(Exception):
10 # True if the environment variable is unset, otherwise False
11 USE_SSL
= os
.environ
.get("RIFT_BOOT_WITHOUT_HTTPS", None) is None
13 def get_bootstrap_cert_and_key():
15 Lookup the bootstrap certificate and key and return their paths
18 user_cert
= os
.path
.join("/", "etc", "ssl", "current.cert")
19 user_key
= os
.path
.join("/", "etc", "ssl", "current.key")
21 if os
.path
.isfile(user_cert
) and os
.path
.isfile(user_key
):
22 return USE_SSL
, user_cert
, user_key
24 rift_install
= os
.environ
["RIFT_INSTALL"]
25 rift_cert
= os
.path
.join(rift_install
, "etc", "ssl", "current.cert")
26 rift_key
= os
.path
.join(rift_install
, "etc", "ssl", "current.key")
28 if os
.path
.isfile(rift_cert
) and os
.path
.isfile(rift_key
):
29 return USE_SSL
, rift_cert
, rift_key
31 raise BootstrapSslMissingException()