public static CURLcode OnSSLContext(SSLContext ctx, Object extraData) { // To do anything useful with the SSLContext object, you'll need // to call the OpenSSL native methods on your own. So for this // demo, we just return what cURL is expecting. return CURLcode.CURLE_OK; }
// called by libcurlshim private static int SSLCtxDelegate(IntPtr ctx, IntPtr parm) { int ok = (int)CURLcode.CURLE_OK; GCHandle gch = (GCHandle)parm; Easy easy = (Easy)gch.Target; if (easy == null) { return(ok); } if (easy.m_pfSSLContext == null) { return(ok); // keep going } SSLContext context = new SSLContext(ctx); return((int)easy.m_pfSSLContext(context, easy.m_sslContextData)); }
// called by libcurlshim private static int SSLCtxDelegate(IntPtr ctx, IntPtr parm) { int ok = (int)CURLcode.CURLE_OK; GCHandle gch = (GCHandle)parm; Easy easy = (Easy)gch.Target; if (easy == null) return ok; if (easy.m_pfSSLContext == null) return ok; // keep going SSLContext context = new SSLContext(ctx); return (int)easy.m_pfSSLContext(context, easy.m_sslContextData); }