@@ -7856,6 +7856,46 @@ module OpenSSL
78567856 # be frozen afterward.
78577857 #
78587858 class SSLContext
7859+ type context_params = {
7860+ ?alpn_protocols=: Array[String]?,
7861+ ?alpn_select_cb=: (^(Array[String]) -> String?)?,
7862+ ?keylog_cb=,
7863+ ?ssl_timeout=: timeout?,
7864+ ?ciphers=: Array[String]?,
7865+ ?ciphersuites=,
7866+ ?tmp_dh=: (^(Session, Integer, Integer) -> PKey::DH)?,
7867+ ?tmp_dh_callback=(^(Session, Integer, Integer) -> PKey::DH)?,
7868+ ?ecdh_curves=: String?,
7869+ ?security_level=: Integer?,
7870+ ?key=: PKey::PKey?,
7871+ ?session_cache_mode=: Integer?,
7872+ ?session_cache_size=: Integer?,
7873+ ?timeout=: Integer?,
7874+ ?options=: Integer?,
7875+ ?servername_cb=: (^(SSLSocket, String) -> SSLContext?)?,
7876+ ?min_version=: tls_version?,
7877+ ?max_version=: tls_version?,
7878+ ?cert=: X509::Certificate?,
7879+ ?client_ca=: Array[X509::Certificate] | X509::Certificate | nil ,
7880+ ?ca_file=: String?,
7881+ ?ca_path=: String?,
7882+ ?verify_mode=: verify_mode?,
7883+ ?verify_depth=: Integer?,
7884+ ?verify_callback=: (^(bool preverify_ok, StoreContext store_ctx) -> boolish)?,
7885+ ?ssl_version=: tls_version?,
7886+ ?verify_hostname=: boolish?,
7887+ ?cert_store=: X509::Store?,
7888+ ?extra_chain_cert=: Array[X509::Certificate]?,
7889+ ?client_cert_cb=: (^(Session) -> [ X509::Certificate, PKey::PKey ]??,
7890+ ?session_id_context=: Integer?,
7891+ ?session_get_cb=: (^(SSLSocket, Integer) -> Session?)?,
7892+ ?session_new_cb=: (^(SSLSocket) -> untyped )?,
7893+ ?session_remove_cb=: (^(SSLContext, Session) -> void )?,
7894+ ?renegotiation_cb=: (^(SSLSocket) -> void )?,
7895+ ?npn_protocols=: Array[String]?,
7896+ ?npn_select_cb=: (^(Array[String]) -> String?)?
7897+ }
7898+
78597899 public
78607900
78617901 # <!--
@@ -8183,7 +8223,7 @@ module OpenSSL
81838223 #
81848224 # ctx.npn_protocols = ["http/1.1", "spdy/2"]
81858225 #
8186- def npn_protocols : () -> untyped
8226+ def npn_protocols : () -> Array[String]?
81878227
81888228 # <!-- rdoc-file=ext/openssl/ossl_ssl.c -->
81898229 # An Enumerable of Strings. Each String represents a protocol to be advertised
@@ -8195,7 +8235,7 @@ module OpenSSL
81958235 #
81968236 # ctx.npn_protocols = ["http/1.1", "spdy/2"]
81978237 #
8198- def npn_protocols= : (untyped ) -> untyped
8238+ def npn_protocols= : (Array[String]? protos ) -> Array[String]
81998239
82008240 # <!-- rdoc-file=ext/openssl/ossl_ssl.c -->
82018241 # A callback invoked on the client side when the client needs to select a
@@ -8213,7 +8253,7 @@ module OpenSSL
82138253 # protocols.first
82148254 # end
82158255 #
8216- def npn_select_cb : () -> untyped
8256+ def npn_select_cb : () -> (^(Array[String]) -> String? | nil )
82178257
82188258 # <!-- rdoc-file=ext/openssl/ossl_ssl.c -->
82198259 # A callback invoked on the client side when the client needs to select a
@@ -8231,7 +8271,7 @@ module OpenSSL
82318271 # protocols.first
82328272 # end
82338273 #
8234- def npn_select_cb= : (untyped ) -> untyped
8274+ def npn_select_cb= : (^(Array[String] ) -> String? alpn_select_callback) -> void
82358275
82368276 # <!--
82378277 # rdoc-file=ext/openssl/ossl_ssl.c
@@ -8504,7 +8544,7 @@ module OpenSSL
85048544 # If the verify_mode is not VERIFY_NONE and ca_file, ca_path and cert_store are
85058545 # not set then the system default certificate store is used.
85068546 #
8507- def set_params : (? untyped params) -> untyped
8547+ def set_params : (context_params params) -> untyped
85088548
85098549 # <!--
85108550 # rdoc-file=ext/openssl/ossl_ssl.c
0 commit comments