diff --git a/wrapper/CSharp/README.md b/wrapper/CSharp/README.md index ea70e4bde..d19adbc25 100644 --- a/wrapper/CSharp/README.md +++ b/wrapper/CSharp/README.md @@ -45,7 +45,7 @@ sudo make install ``` cd wrapper/CSharp -msc wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \ +mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs \ wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs ``` diff --git a/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs b/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs index c59c3e00b..e64781438 100644 --- a/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs +++ b/wrapper/CSharp/wolfSSL_CSharp/wolfSSL.cs @@ -290,6 +290,17 @@ namespace wolfSSL.CSharp { [DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)] private extern static int wolfSSL_CTX_use_psk_identity_hint(IntPtr ctx, StringBuilder identity); + /******************************** + * SNI + */ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate int sni_delegate(IntPtr ssl, IntPtr ret, IntPtr exArg); + [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 void wolfSSL_CTX_set_tlsext_servername_callback(IntPtr ctx, sni_delegate sni_cb); + [DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)] + private extern static void wolfSSL_CTX_set_servername_arg(IntPtr ctx, IntPtr arg); /******************************** * SSL Structure