@@ -60,12 +60,14 @@ class Server: # pylint: disable=too-many-instance-attributes
6060 """Root directory to serve files from. ``None`` if serving files is disabled."""
6161
6262 @staticmethod
63- def _validate_https_cert_provided (certfile : str , keyfile : str ) -> None :
64- if not certfile or not keyfile :
63+ def _validate_https_cert_provided (
64+ certfile : Union [str , None ], keyfile : Union [str , None ]
65+ ) -> None :
66+ if certfile is None or keyfile is None :
6567 raise ValueError ("Both certfile and keyfile must be specified for HTTPS" )
6668
6769 @staticmethod
68- def __create_circuitpython_ssl_context (certfile : str , keyfile : str ) -> SSLContext :
70+ def _create_circuitpython_ssl_context (certfile : str , keyfile : str ) -> SSLContext :
6971 ssl_context = create_default_context ()
7072
7173 ssl_context .load_verify_locations (cadata = "" )
@@ -74,7 +76,7 @@ def __create_circuitpython_ssl_context(certfile: str, keyfile: str) -> SSLContex
7476 return ssl_context
7577
7678 @staticmethod
77- def __create_cpython_ssl_context (certfile : str , keyfile : str ) -> SSLContext :
79+ def _create_cpython_ssl_context (certfile : str , keyfile : str ) -> SSLContext :
7880 ssl_context = create_default_context (purpose = Purpose .CLIENT_AUTH )
7981
8082 ssl_context .load_cert_chain (certfile , keyfile )
@@ -87,9 +89,9 @@ def __create_cpython_ssl_context(certfile: str, keyfile: str) -> SSLContext:
8789 @classmethod
8890 def _create_ssl_context (cls , certfile : str , keyfile : str ) -> SSLContext :
8991 return (
90- cls .__create_circuitpython_ssl_context (certfile , keyfile )
92+ cls ._create_circuitpython_ssl_context (certfile , keyfile )
9193 if implementation .name == "circuitpython"
92- else cls .__create_cpython_ssl_context (certfile , keyfile )
94+ else cls ._create_cpython_ssl_context (certfile , keyfile )
9395 )
9496
9597 def __init__ (
0 commit comments