@@ -330,6 +330,10 @@ public void free()
330330 private extern static int wolfSSL_CTX_UseSNI ( IntPtr ctx , byte type , IntPtr data , ushort size ) ;
331331 [ DllImport ( wolfssl_dll , CallingConvention = CallingConvention . Cdecl ) ]
332332 private extern static int wolfSSL_UseSNI ( IntPtr ssl , byte type , IntPtr data , ushort size ) ;
333+ [ DllImport ( wolfssl_dll , CallingConvention = CallingConvention . Cdecl ) ]
334+ private extern static ushort wolfSSL_SNI_GetRequest ( IntPtr ssl , byte type , ref IntPtr data ) ;
335+ [ DllImport ( wolfssl_dll , CallingConvention = CallingConvention . Cdecl ) ]
336+ private extern static int wolfSSL_SNI_GetFromBuffer ( StringBuilder clientHello , uint helloSz , byte type , IntPtr sni , IntPtr inOutSz ) ;
333337
334338 /********************************
335339 * SSL Structure
@@ -1200,6 +1204,29 @@ public static int UseSNI(IntPtr ssl, byte type, IntPtr data, ushort size)
12001204 }
12011205 }
12021206
1207+ public static ushort SNI_GetRequest ( IntPtr ssl , byte type , ref IntPtr data )
1208+ {
1209+ try {
1210+ GCHandle gch = GCHandle . FromIntPtr ( ssl ) ;
1211+ ssl_handle handles = ( ssl_handle ) gch . Target ;
1212+
1213+ return wolfSSL_SNI_GetRequest ( handles . get_ssl ( ) , type , ref data ) ;
1214+ } catch ( Exception e ) {
1215+ log ( ERROR_LOG , "wolfssl sni get request error: " + e . ToString ( ) ) ;
1216+ return ushort . MaxValue ;
1217+ }
1218+ }
1219+
1220+ public static int SNI_GetFromBuffer ( StringBuilder clientHello , uint helloSz , byte type , IntPtr sni , IntPtr inOutSz )
1221+ {
1222+ try {
1223+ return wolfSSL_SNI_GetFromBuffer ( clientHello , helloSz , type , sni , inOutSz ) ;
1224+ } catch ( Exception e ) {
1225+ log ( ERROR_LOG , "wolfssl sni get from buffer error: " + e . ToString ( ) ) ;
1226+ return FAILURE ;
1227+ }
1228+ }
1229+
12031230 /// <summary>
12041231 /// Set identity hint to use
12051232 /// </summary>
0 commit comments