@@ -222,7 +222,7 @@ def _parse_hostlist(hostlist, port, *, unquote=False):
222222
223223def _parse_connect_dsn_and_args (* , dsn , host , port , user ,
224224 password , passfile , database , ssl ,
225- sslcert , sslkey , sslrootcert ,
225+ sslcert , sslkey , sslrootcert , sslcrl ,
226226 connect_timeout , server_settings ):
227227 # `auth_hosts` is the version of host information for the purposes
228228 # of reading the pgpass file.
@@ -326,6 +326,11 @@ def _parse_connect_dsn_and_args(*, dsn, host, port, user,
326326 if sslrootcert is None :
327327 sslrootcert = val
328328
329+ if 'sslcrl' in query :
330+ val = query .pop ('sslcrl' )
331+ if sslcrl is None :
332+ sslcrl = val
333+
329334 if query :
330335 if server_settings is None :
331336 server_settings = query
@@ -443,7 +448,6 @@ def _parse_connect_dsn_and_args(*, dsn, host, port, user,
443448 '`sslmode` parameter must be one of: {}' .format (modes ))
444449
445450 # docs at https://www.postgresql.org/docs/10/static/libpq-connect.html
446- # Not implemented: sslcrl param.
447451 if sslmode < SSLMode .allow :
448452 ssl = False
449453 else :
@@ -462,12 +466,18 @@ def _parse_connect_dsn_and_args(*, dsn, host, port, user,
462466 if sslrootcert is None :
463467 sslrootcert = os .getenv ('PGSSLROOTCERT' )
464468
469+ if sslcrl is None :
470+ sslcrl = os .getenv ('PGSSLCRL' )
471+
465472 if sslcert :
466473 ssl .load_cert_chain (sslcert , keyfile = sslkey )
467474
468475 if sslrootcert :
469476 ssl .load_verify_locations (cafile = sslrootcert )
470477
478+ if sslcrl :
479+ ssl .load_verify_locations (cafile = sslcrl )
480+
471481 elif ssl is True :
472482 ssl = ssl_module .create_default_context ()
473483 sslmode = SSLMode .verify_full
@@ -495,7 +505,7 @@ def _parse_connect_arguments(*, dsn, host, port, user, password, passfile,
495505 statement_cache_size ,
496506 max_cached_statement_lifetime ,
497507 max_cacheable_statement_size ,
498- ssl , sslcert , sslkey , sslrootcert ,
508+ ssl , sslcert , sslkey , sslrootcert , sslcrl ,
499509 server_settings ):
500510
501511 local_vars = locals ()
@@ -525,7 +535,7 @@ def _parse_connect_arguments(*, dsn, host, port, user, password, passfile,
525535 dsn = dsn , host = host , port = port , user = user ,
526536 password = password , passfile = passfile , ssl = ssl ,
527537 sslcert = sslcert , sslkey = sslkey , sslrootcert = sslrootcert ,
528- database = database , connect_timeout = timeout ,
538+ sslcrl = sslcrl , database = database , connect_timeout = timeout ,
529539 server_settings = server_settings )
530540
531541 config = _ClientConfiguration (
0 commit comments