Ticket #28595: libsocketsfix.patch

File libsocketsfix.patch, 2.2 KB (added by bhology@…, 14 years ago)

Patch to libsockets to fix the issue

  • TcpSocket.cpp

    diff --git a/TcpSocket.cpp b/TcpSocket.cpp
    index d304637..e0a14d1 100644
    a b void TcpSocket::InitSSLServer() 
    12341234}
    12351235
    12361236
    1237 void TcpSocket::InitializeContext(const std::string& context, SSL_METHOD *meth_in)
     1237void TcpSocket::InitializeContext(const std::string& context, const SSL_METHOD *meth_in)
    12381238{
    12391239        static Mutex mutex;
    12401240        Lock lock(mutex);
    12411241        /* Create our context*/
    12421242        if (m_client_contexts.find(context) == m_client_contexts.end())
    12431243        {
    1244                 SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method();
     1244                const SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method();
    12451245                m_ssl_ctx = m_client_contexts[context] = SSL_CTX_new(meth);
    12461246                SSL_CTX_set_mode(m_ssl_ctx, SSL_MODE_AUTO_RETRY);
    12471247        }
    void TcpSocket::InitializeContext(const std::string& context,const std::string& 
    12581258        /* Create our context*/
    12591259        if (m_server_contexts.find(context) == m_server_contexts.end())
    12601260        {
    1261                 SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method();
     1261                const SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method();
    12621262                m_ssl_ctx = m_server_contexts[context] = SSL_CTX_new(meth);
    12631263                SSL_CTX_set_mode(m_ssl_ctx, SSL_MODE_AUTO_RETRY);
    12641264                // session id
    void TcpSocket::InitializeContext(const std::string& context,const std::string& 
    12941294        /* Create our context*/
    12951295        if (m_server_contexts.find(context) == m_server_contexts.end())
    12961296        {
    1297                 SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method();
     1297                const SSL_METHOD *meth = meth_in ? meth_in : SSLv3_method();
    12981298                m_ssl_ctx = m_server_contexts[context] = SSL_CTX_new(meth);
    12991299                SSL_CTX_set_mode(m_ssl_ctx, SSL_MODE_AUTO_RETRY);
    13001300                // session id
  • TcpSocket.h

    diff --git a/TcpSocket.h b/TcpSocket.h
    index 89d803a..28933e2 100644
    a b protected: 
    271271#ifdef HAVE_OPENSSL
    272272        /** SSL; Initialize ssl context for a client socket.
    273273                \param meth_in SSL method */
    274         void InitializeContext(const std::string& context, SSL_METHOD *meth_in = NULL);
     274        void InitializeContext(const std::string& context, const SSL_METHOD *meth_in = NULL);
    275275        /** SSL; Initialize ssl context for a server socket.
    276276                \param keyfile Combined private key/certificate file
    277277                \param password Password for private key