@@ -7856,6 +7856,46 @@ module OpenSSL
7856
7856
# be frozen afterward.
7857
7857
#
7858
7858
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
+
7859
7899
public
7860
7900
7861
7901
# <!--
@@ -8183,7 +8223,7 @@ module OpenSSL
8183
8223
#
8184
8224
# ctx.npn_protocols = ["http/1.1", "spdy/2"]
8185
8225
#
8186
- def npn_protocols : () -> untyped
8226
+ def npn_protocols : () -> Array[String]?
8187
8227
8188
8228
# <!-- rdoc-file=ext/openssl/ossl_ssl.c -->
8189
8229
# An Enumerable of Strings. Each String represents a protocol to be advertised
@@ -8195,7 +8235,7 @@ module OpenSSL
8195
8235
#
8196
8236
# ctx.npn_protocols = ["http/1.1", "spdy/2"]
8197
8237
#
8198
- def npn_protocols= : (untyped ) -> untyped
8238
+ def npn_protocols= : (Array[String]? protos ) -> Array[String]
8199
8239
8200
8240
# <!-- rdoc-file=ext/openssl/ossl_ssl.c -->
8201
8241
# A callback invoked on the client side when the client needs to select a
@@ -8213,7 +8253,7 @@ module OpenSSL
8213
8253
# protocols.first
8214
8254
# end
8215
8255
#
8216
- def npn_select_cb : () -> untyped
8256
+ def npn_select_cb : () -> (^(Array[String]) -> String? | nil )
8217
8257
8218
8258
# <!-- rdoc-file=ext/openssl/ossl_ssl.c -->
8219
8259
# A callback invoked on the client side when the client needs to select a
@@ -8231,7 +8271,7 @@ module OpenSSL
8231
8271
# protocols.first
8232
8272
# end
8233
8273
#
8234
- def npn_select_cb= : (untyped ) -> untyped
8274
+ def npn_select_cb= : (^(Array[String] ) -> String? alpn_select_callback) -> void
8235
8275
8236
8276
# <!--
8237
8277
# rdoc-file=ext/openssl/ossl_ssl.c
@@ -8504,7 +8544,7 @@ module OpenSSL
8504
8544
# If the verify_mode is not VERIFY_NONE and ca_file, ca_path and cert_store are
8505
8545
# not set then the system default certificate store is used.
8506
8546
#
8507
- def set_params : (? untyped params) -> untyped
8547
+ def set_params : (context_params params) -> untyped
8508
8548
8509
8549
# <!--
8510
8550
# rdoc-file=ext/openssl/ossl_ssl.c
0 commit comments