Beispiel #1
0
 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;
 }
Beispiel #2
0
        // 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));
        }
Beispiel #3
0
 // 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);
 }