[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] Re: Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protoco

From: Farhan Husain
Subject: [libmicrohttpd] Re: Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
Date: Wed, 23 Mar 2011 16:35:03 -0500


I still could not find the solution. Is there anyone having the same experience?


On Fri, Dec 31, 2010 at 5:12 PM, Farhan Husain <address@hidden> wrote:

I am trying to use the SSL support in libmicrohttp. I followed the tutorial and the example given here: However, I am not successful in getting a page from the server. I am getting the following errors:

1. With Chrome: Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
2. With Firefox: A blank page
3. With curl ("curl -k https://myip:myport/something"): I see some text with a lot of garbage (i.e. non-printable ASCII) characters.

Here is the code I am using:

           _daemon = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_SSL, _port, NULL, NULL, &answerToConnection, this,
                                MHD_OPTION_THREAD_POOL_SIZE, conf->getWebServiceThreadPoolSize(),
                                MHD_OPTION_SOCK_ADDR, reinterpret_cast<struct sockaddr *> (&web_service_addr),
                                MHD_OPTION_NOTIFY_COMPLETED, &requestCompleted, NULL,
                                MHD_OPTION_HTTPS_MEM_KEY, _keyFileContent.get(),
                                MHD_OPTION_HTTPS_MEM_CERT, _certFileContent.get(),

Here is the definition of _keyFileContent and _certFileContent:

        typedef boost::shared_array<char> SharedCharArray_t;
        SharedCharArray_t _keyFileContent;
        SharedCharArray_t _certFileContent;            
        _keyFileContent = Utility::loadFile(keyFileName);
        _certFileContent = Utility::loadFile(certFileName);

I have attached the C++ source file containing the code of Utility::loadFile() so that the email does not get too long. Can anyone please tell me what I am doing wrong? I printed the contents of the char arrays and they look fine except there are some garbage characters at the end because I did not terminate the array with a NULL character. I don't see the example doing it and that's what I followed. I found a thread in the archive talking about the same problem but there was no solution to the problem. I would appreciate any kind of help.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]