Skip to content

Commit 82edc1e

Browse files
committed
Take a ref receiver on the SSLContext option mutators
`_set_options` and `_clear_options` reconfigure the OpenSSL context, but took the default `box` receiver, which a `val` receiver satisfies. An `SSLContext` is held `val` once it is done being configured — `client` and `server` require it — so a `fun val` or `fun box` method added later could have reconfigured a frozen context and compiled. Closes #93
1 parent 8d9853e commit 82edc1e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ssl/net/ssl_context.pony

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class val SSLContext
8787
compile_error "You must select an SSL version to use."
8888
end
8989

90-
fun _set_options(opts: U64) =>
90+
fun ref _set_options(opts: U64) =>
9191
ifdef "openssl_3.0.x" or "openssl_4.0.x" then
9292
@SSL_CTX_set_options(_ctx, opts)
9393
elseif "openssl_1.1.x" then
@@ -98,7 +98,7 @@ class val SSLContext
9898
compile_error "You must select an SSL version to use."
9999
end
100100

101-
fun _clear_options(opts: U64) =>
101+
fun ref _clear_options(opts: U64) =>
102102
ifdef "openssl_3.0.x" or "openssl_4.0.x" then
103103
@SSL_CTX_clear_options(_ctx, opts)
104104
elseif "openssl_1.1.x" then

0 commit comments

Comments
 (0)