17
17
from certipy import Certipy
18
18
from consul .aio import Consul
19
19
from jupyterhub .utils import exponential_backoff
20
- from passlib .hash import apr_md5_crypt
21
20
from traitlets .log import get_logger
22
21
23
22
from jupyterhub_traefik_proxy .consul import TraefikConsulProxy
@@ -60,15 +59,6 @@ class Config:
60
59
public_url = "https://127.0.0.1:8000"
61
60
62
61
63
- # initial kv config for the API for external kv-stores
64
- _kv_config = {
65
- "traefik/http/middlewares/auth_api/basicAuth/users/0" : f"{ Config .traefik_api_user } :{ apr_md5_crypt (Config .traefik_api_pass )} " ,
66
- "traefik/http/routers/route_api/entryPoints/0" : "auth_api" ,
67
- "traefik/http/routers/route_api/middlewares/0" : "auth_api" ,
68
- "traefik/http/routers/route_api/rule" : "(Host(`127.0.0.1`) || Host(`localhost`)) && PathPrefix(`/api`)" ,
69
- "traefik/http/routers/route_api/service" : "api@internal" ,
70
- }
71
-
72
62
# Define a "slow" test marker so that we can run the slow tests at the end
73
63
74
64
@@ -300,16 +290,16 @@ def _check_ssl(proxy, client_ca):
300
290
context .load_cert_chain (proxy .ssl_cert , proxy .ssl_key )
301
291
302
292
url = urlparse (Config .public_url )
303
- cert = ssl .get_server_certificate ((url .hostname , url .port ))
304
- from cryptography import x509
305
- from cryptography .hazmat .backends import default_backend
293
+ ssl .get_server_certificate ((url .hostname , url .port ))
306
294
307
- certDecoded = x509 .load_pem_x509_certificate (str .encode (cert ), default_backend ())
308
- print (certDecoded )
309
- print (certDecoded .issuer )
310
- print (certDecoded .subject )
311
- print (certDecoded .not_valid_after )
312
- print (certDecoded .not_valid_before )
295
+ # from cryptography import x509
296
+ # from cryptography.hazmat.backends import default_backend
297
+ # certDecoded = x509.load_pem_x509_certificate(str.encode(cert), default_backend())
298
+ # print(certDecoded)
299
+ # print(certDecoded.issuer)
300
+ # print(certDecoded.subject)
301
+ # print(certDecoded.not_valid_after)
302
+ # print(certDecoded.not_valid_before)
313
303
314
304
conn = context .wrap_socket (
315
305
socket .socket (socket .AF_INET ),
@@ -318,9 +308,7 @@ def _check_ssl(proxy, client_ca):
318
308
# 5 second timeout
319
309
conn .settimeout (5.0 )
320
310
conn .connect ((url .hostname , url .port ))
321
- ssl_info = conn .getpeercert ()
322
- print (ssl_info , type (ssl_info ))
323
- # assert ssl_info == None
311
+ conn .getpeercert ()
324
312
325
313
326
314
@pytest .fixture
@@ -553,8 +541,6 @@ def _enable_auth_in_etcd(*common_args):
553
541
@pytest .fixture
554
542
async def launch_etcd_auth (etcd_ssl_key_cert , etcd_client_ca ):
555
543
key , cert = etcd_ssl_key_cert
556
- print (f"{ key = } { cert = } " )
557
- os .system (f"openssl x509 -nooout -text -in { cert } " )
558
544
etcd_proc = subprocess .Popen (
559
545
[
560
546
"etcd" ,
0 commit comments