- Applied David's patch to get access to the missing sni callback (arg)

- removed tlsext callback (since it's a compatibility one)
- updated testing examples and wrapper
This commit is contained in:
gasbytes
2024-06-04 18:26:01 +02:00
parent 5d0b7e0d18
commit 983610ed68
4 changed files with 31 additions and 48 deletions

View File

@@ -325,8 +325,6 @@ namespace wolfSSL.CSharp {
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
private extern static void wolfSSL_CTX_set_servername_callback(IntPtr ctx, sni_delegate sni_cb);
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
private extern static int wolfSSL_CTX_set_tlsext_servername_callback(IntPtr ctx, sni_delegate sni_cb);
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
private extern static int wolfSSL_CTX_set_servername_arg(IntPtr ctx, IntPtr arg);
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
private extern static int wolfSSL_CTX_UseSNI(IntPtr ctx, byte type, IntPtr data, ushort size);
@@ -1141,21 +1139,6 @@ namespace wolfSSL.CSharp {
}
}
public static int CTX_set_tlsext_servername_callback(IntPtr ctx, sni_delegate sni_cb)
{
try {
GCHandle gch = GCHandle.FromIntPtr(ctx);
ctx_handle handles = (ctx_handle)gch.Target;
handles.set_sni(GCHandle.Alloc(sni_cb));
return wolfSSL_CTX_set_tlsext_servername_callback(handles.get_ctx(), sni_cb);
} catch (Exception e) {
log(ERROR_LOG, "wolfssl tlsext servername callback error: " + e.ToString());
return FAILURE;
}
}
public static int CTX_set_servername_arg(IntPtr ctx, IntPtr arg)
{
try {