mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 11:06:50 +01:00
Merge pull request #943 from zosrothko/develop
Proposed changes for fixing NetSSL_OpenSSL and adding portability function in Sharedmemory
This commit is contained in:
@@ -121,7 +121,7 @@ public:
|
|||||||
static std::string prefix();
|
static std::string prefix();
|
||||||
/// Returns the platform-specific filename prefix
|
/// Returns the platform-specific filename prefix
|
||||||
/// for shared libraries.
|
/// for shared libraries.
|
||||||
/// Most platforms would return an empty string, but
|
/// Most platforms would return "lib" as prefix, while
|
||||||
/// on Cygwin, the "cyg" prefix will be returned.
|
/// on Cygwin, the "cyg" prefix will be returned.
|
||||||
|
|
||||||
static std::string suffix();
|
static std::string suffix();
|
||||||
@@ -130,6 +130,11 @@ public:
|
|||||||
/// In debug mode, the suffix also includes a
|
/// In debug mode, the suffix also includes a
|
||||||
/// "d" to specify the debug version of a library.
|
/// "d" to specify the debug version of a library.
|
||||||
|
|
||||||
|
static std::string getOSName(const std::string& name);
|
||||||
|
/// Returns the platform-specific filename
|
||||||
|
/// for shared libraries by prefixing and suffixing name
|
||||||
|
/// with prefix() and suffix()
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SharedLibrary(const SharedLibrary&);
|
SharedLibrary(const SharedLibrary&);
|
||||||
SharedLibrary& operator = (const SharedLibrary&);
|
SharedLibrary& operator = (const SharedLibrary&);
|
||||||
|
|||||||
@@ -115,5 +115,9 @@ std::string SharedLibrary::suffix()
|
|||||||
return suffixImpl();
|
return suffixImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string SharedLibrary::getOSName(const std::string& name)
|
||||||
|
{
|
||||||
|
return prefix() + name + suffix();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Poco
|
} // namespace Poco
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ const std::string& SharedLibraryImpl::getPathImpl() const
|
|||||||
|
|
||||||
std::string SharedLibraryImpl::prefixImpl()
|
std::string SharedLibraryImpl::prefixImpl()
|
||||||
{
|
{
|
||||||
return "";
|
return "lib";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ std::string SharedLibraryImpl::prefixImpl()
|
|||||||
#if POCO_OS == POCO_OS_CYGWIN
|
#if POCO_OS == POCO_OS_CYGWIN
|
||||||
return "cyg";
|
return "cyg";
|
||||||
#else
|
#else
|
||||||
return "";
|
return "lib";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
#
|
#
|
||||||
# Makefile for Poco NetSSL_OpenSSL
|
# Makefile for Poco NetSSL_OpenSSL
|
||||||
#
|
#
|
||||||
|
|
||||||
include $(POCO_BASE)/build/rules/global
|
include $(POCO_BASE)/build/rules/global
|
||||||
|
|
||||||
SYSLIBS += -lssl -lcrypto
|
SYSLIBS += -lssl -lcrypto
|
||||||
|
|||||||
@@ -333,13 +333,19 @@ void Context::createSSLContext()
|
|||||||
case SERVER_USE:
|
case SERVER_USE:
|
||||||
_pSSLContext = SSL_CTX_new(SSLv23_server_method());
|
_pSSLContext = SSL_CTX_new(SSLv23_server_method());
|
||||||
break;
|
break;
|
||||||
|
#if defined(SSL_OP_NO_TLSv1) && !defined(OPENSSL_NO_TLS1)
|
||||||
case TLSV1_CLIENT_USE:
|
case TLSV1_CLIENT_USE:
|
||||||
_pSSLContext = SSL_CTX_new(TLSv1_client_method());
|
_pSSLContext = SSL_CTX_new(TLSv1_client_method());
|
||||||
break;
|
break;
|
||||||
case TLSV1_SERVER_USE:
|
case TLSV1_SERVER_USE:
|
||||||
_pSSLContext = SSL_CTX_new(TLSv1_server_method());
|
_pSSLContext = SSL_CTX_new(TLSv1_server_method());
|
||||||
break;
|
break;
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
|
#endif
|
||||||
|
#if defined(SSL_OP_NO_TLSv1_1) && !defined(OPENSSL_NO_TLS1)
|
||||||
|
/* SSL_OP_NO_TLSv1_1 is defined in ssl.h if the library version supports TLSv1.1.
|
||||||
|
* OPENSSL_NO_TLS1 is defined in opensslconf.h or on the compiler command line
|
||||||
|
* if TLS1.x was removed at OpenSSL library build time via Configure options.
|
||||||
|
*/
|
||||||
case TLSV1_1_CLIENT_USE:
|
case TLSV1_1_CLIENT_USE:
|
||||||
_pSSLContext = SSL_CTX_new(TLSv1_1_client_method());
|
_pSSLContext = SSL_CTX_new(TLSv1_1_client_method());
|
||||||
break;
|
break;
|
||||||
@@ -347,7 +353,7 @@ void Context::createSSLContext()
|
|||||||
_pSSLContext = SSL_CTX_new(TLSv1_1_server_method());
|
_pSSLContext = SSL_CTX_new(TLSv1_1_server_method());
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x10001000L
|
#if defined(SSL_OP_NO_TLSv1_2) && !defined(OPENSSL_NO_TLS1)
|
||||||
case TLSV1_2_CLIENT_USE:
|
case TLSV1_2_CLIENT_USE:
|
||||||
_pSSLContext = SSL_CTX_new(TLSv1_2_client_method());
|
_pSSLContext = SSL_CTX_new(TLSv1_2_client_method());
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user