@@ -25,6 +25,7 @@ pub struct PgConnectOptions {
2525 pub ( crate ) ssl_root_cert : Option < CertificateInput > ,
2626 pub ( crate ) ssl_client_cert : Option < CertificateInput > ,
2727 pub ( crate ) ssl_client_key : Option < CertificateInput > ,
28+ pub ( crate ) ssl_enable_keylog : bool ,
2829 pub ( crate ) statement_cache_capacity : usize ,
2930 pub ( crate ) application_name : Option < String > ,
3031 pub ( crate ) log_settings : LogSettings ,
@@ -92,6 +93,7 @@ impl PgConnectOptions {
9293 . ok ( )
9394 . and_then ( |v| v. parse ( ) . ok ( ) )
9495 . unwrap_or_default ( ) ,
96+ ssl_enable_keylog : false ,
9597 statement_cache_capacity : 100 ,
9698 application_name : var ( "PGAPPNAME" ) . ok ( ) ,
9799 extra_float_digits : Some ( "2" . into ( ) ) ,
@@ -225,6 +227,14 @@ impl PgConnectOptions {
225227 self
226228 }
227229
230+ /// Enables the use of the `SSLKEYLOGFILE`` environment variable to export SSL session keys.
231+ ///
232+ /// Only works with the `rustls` SSL backend
233+ pub fn ssl_enable_keylog ( mut self , enable : bool ) -> Self {
234+ self . ssl_enable_keylog = enable;
235+ self
236+ }
237+
228238 /// Sets the name of a file containing SSL certificate authority (CA) certificate(s).
229239 /// If the file exists, the server's certificate will be verified to be signed by
230240 /// one of these authorities.
0 commit comments