mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-13 22:50:17 +02:00
NetSSL_OpenSSL: complete merge to 1.4.2
This commit is contained in:
@@ -10,15 +10,15 @@ include $(POCO_BASE)/build/rules/global
|
|||||||
|
|
||||||
SYSLIBS += -lssl -lcrypto
|
SYSLIBS += -lssl -lcrypto
|
||||||
|
|
||||||
objects = AcceptCertificateHandler CertificateHandlerFactory \
|
objects = AcceptCertificateHandler RejectCertificateHandler ConsoleCertificateHandler \
|
||||||
CertificateHandlerFactoryMgr ConsoleCertificateHandler \
|
CertificateHandlerFactory CertificateHandlerFactoryMgr \
|
||||||
Context HTTPSClientSession HTTPSStreamFactory HTTPSSessionInstantiator \
|
Context HTTPSClientSession HTTPSStreamFactory HTTPSSessionInstantiator \
|
||||||
InvalidCertificateHandler KeyConsoleHandler \
|
InvalidCertificateHandler KeyConsoleHandler \
|
||||||
KeyFileHandler PrivateKeyFactory PrivateKeyFactoryMgr \
|
KeyFileHandler PrivateKeyFactory PrivateKeyFactoryMgr \
|
||||||
PrivateKeyPassphraseHandler SecureServerSocket SecureServerSocketImpl \
|
PrivateKeyPassphraseHandler SecureServerSocket SecureServerSocketImpl \
|
||||||
SecureSocketImpl SecureStreamSocket SecureStreamSocketImpl \
|
SecureSocketImpl SecureStreamSocket SecureStreamSocketImpl \
|
||||||
SSLException SSLManager Utility VerificationErrorArgs \
|
SSLException SSLManager Utility VerificationErrorArgs \
|
||||||
X509Certificate
|
X509Certificate Session SecureSMTPClientSession
|
||||||
|
|
||||||
target = PocoNetSSL
|
target = PocoNetSSL
|
||||||
target_version = $(LIBVERSION)
|
target_version = $(LIBVERSION)
|
||||||
|
60
NetSSL_OpenSSL/NetSSL_OpenSSL_vs100.sln
Normal file
60
NetSSL_OpenSSL/NetSSL_OpenSSL_vs100.sln
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
|
# Visual Studio 2010
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetSSL_OpenSSL", "NetSSL_OpenSSL_vs100.vcxproj", "{5AECC55E-A469-11DA-8DA6-005056C00008}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs100.vcxproj", "{B2B88092-5BCE-4AC0-941E-88167138B4A7}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008} = {5AECC55E-A469-11DA-8DA6-005056C00008}
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
debug_shared|Win32 = debug_shared|Win32
|
||||||
|
release_shared|Win32 = release_shared|Win32
|
||||||
|
debug_static_mt|Win32 = debug_static_mt|Win32
|
||||||
|
release_static_mt|Win32 = release_static_mt|Win32
|
||||||
|
debug_static_md|Win32 = debug_static_md|Win32
|
||||||
|
release_static_md|Win32 = release_static_md|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_shared|Win32.Build.0 = debug_shared|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_shared|Win32.ActiveCfg = release_shared|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_shared|Win32.Build.0 = release_shared|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_shared|Win32.Deploy.0 = release_shared|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_md|Win32.Build.0 = release_static_md|Win32
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_shared|Win32.Build.0 = debug_shared|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_shared|Win32.ActiveCfg = release_shared|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_shared|Win32.Build.0 = release_shared|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_shared|Win32.Deploy.0 = release_shared|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_md|Win32.Build.0 = release_static_md|Win32
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
330
NetSSL_OpenSSL/NetSSL_OpenSSL_vs100.vcxproj
Normal file
330
NetSSL_OpenSSL/NetSSL_OpenSSL_vs100.vcxproj
Normal file
@@ -0,0 +1,330 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="debug_shared|Win32">
|
||||||
|
<Configuration>debug_shared</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_md|Win32">
|
||||||
|
<Configuration>debug_static_md</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_mt|Win32">
|
||||||
|
<Configuration>debug_static_mt</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_shared|Win32">
|
||||||
|
<Configuration>release_shared</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_md|Win32">
|
||||||
|
<Configuration>release_static_md</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_mt|Win32">
|
||||||
|
<Configuration>release_static_mt</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectName>NetSSL_OpenSSL</ProjectName>
|
||||||
|
<ProjectGuid>{5AECC55E-A469-11DA-8DA6-005056C00008}</ProjectGuid>
|
||||||
|
<RootNamespace>NetSSL_OpenSSL</RootNamespace>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
|
||||||
|
<ImportGroup Label="ExtensionSettings"/>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros"/>
|
||||||
|
<PropertyGroup>
|
||||||
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">..\bin\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">..\bin\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">..\lib\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">..\lib\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">..\lib\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">..\lib\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">PocoNetSSLd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">PocoNetSSLmdd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">PocoNetSSLmtd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">PocoNetSSL</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">PocoNetSSLmd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">PocoNetSSLmt</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NetSSL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>..\bin\PocoNetSSLd.dll</OutputFile>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>..\bin\PocoNetSSLd.pdb</ProgramDatabaseFile>
|
||||||
|
<AdditionalLibraryDirectories>..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<ImportLibrary>..\lib\PocoNetSSLd.lib</ImportLibrary>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;NetSSL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>..\bin\PocoNetSSL.dll</OutputFile>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<ImportLibrary>..\lib\PocoNetSSL.lib</ImportLibrary>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<ProgramDataBaseFileName>..\lib\PocoNetSSLmtd.pdb</ProgramDataBaseFileName>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Lib>
|
||||||
|
<OutputFile>..\lib\PocoNetSSLmtd.lib</OutputFile>
|
||||||
|
</Lib>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Lib>
|
||||||
|
<OutputFile>..\lib\PocoNetSSLmt.lib</OutputFile>
|
||||||
|
</Lib>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<ProgramDataBaseFileName>..\lib\PocoNetSSLmdd.pdb</ProgramDataBaseFileName>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Lib>
|
||||||
|
<OutputFile>..\lib\PocoNetSSLmdd.lib</OutputFile>
|
||||||
|
</Lib>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<ProgramDataBaseFileName>..\lib\PocoNetSSLmd.pdb</ProgramDataBaseFileName>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Lib>
|
||||||
|
<AdditionalDependencies>libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>..\lib\PocoNetSSLmd.lib</OutputFile>
|
||||||
|
</Lib>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="include\Poco\Net\AcceptCertificateHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\CertificateHandlerFactory.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\CertificateHandlerFactoryMgr.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\ConsoleCertificateHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\Context.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\InvalidCertificateHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\KeyConsoleHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\KeyFileHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\NetSSL.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyFactory.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyFactoryMgr.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyPassphraseHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\RejectCertificateHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\Session.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SSLException.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SSLManager.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\Utility.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\VerificationErrorArgs.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\X509Certificate.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSClientSession.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSSessionInstantiator.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSStreamFactory.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureServerSocket.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureServerSocketImpl.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureSocketImpl.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureStreamSocket.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureStreamSocketImpl.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureSMTPClientSession.h"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\AcceptCertificateHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\CertificateHandlerFactory.cpp"/>
|
||||||
|
<ClCompile Include="src\CertificateHandlerFactoryMgr.cpp"/>
|
||||||
|
<ClCompile Include="src\ConsoleCertificateHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\Context.cpp"/>
|
||||||
|
<ClCompile Include="src\InvalidCertificateHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\KeyConsoleHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\KeyFileHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\PrivateKeyFactory.cpp"/>
|
||||||
|
<ClCompile Include="src\PrivateKeyFactoryMgr.cpp"/>
|
||||||
|
<ClCompile Include="src\PrivateKeyPassphraseHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\RejectCertificateHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\Session.cpp"/>
|
||||||
|
<ClCompile Include="src\SSLException.cpp"/>
|
||||||
|
<ClCompile Include="src\SSLManager.cpp"/>
|
||||||
|
<ClCompile Include="src\Utility.cpp"/>
|
||||||
|
<ClCompile Include="src\VerificationErrorArgs.cpp"/>
|
||||||
|
<ClCompile Include="src\X509Certificate.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSClientSession.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSSessionInstantiator.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSStreamFactory.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureServerSocket.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureServerSocketImpl.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureSocketImpl.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureStreamSocket.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureStreamSocketImpl.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureSMTPClientSession.cpp"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
|
||||||
|
<ImportGroup Label="ExtensionTargets"/>
|
||||||
|
</Project>
|
210
NetSSL_OpenSSL/NetSSL_OpenSSL_vs100.vcxproj.filters
Normal file
210
NetSSL_OpenSSL/NetSSL_OpenSSL_vs100.vcxproj.filters
Normal file
@@ -0,0 +1,210 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="SSLCore">
|
||||||
|
<UniqueIdentifier>{7dfc0f8e-4040-493b-a52c-1cf7016ce630}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="SSLCore\Header Files">
|
||||||
|
<UniqueIdentifier>{cbdd06c0-5e7c-4872-8e94-9aec1737ccb4}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="SSLCore\Source Files">
|
||||||
|
<UniqueIdentifier>{faed5eaa-7df0-43b2-9e14-dda9415e3119}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient">
|
||||||
|
<UniqueIdentifier>{a101ea91-6383-421c-8ffe-b72ad78e9f47}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient\Header Files">
|
||||||
|
<UniqueIdentifier>{2d63ba0b-8c3c-4aa4-9c2d-59650588ca07}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient\Source Files">
|
||||||
|
<UniqueIdentifier>{95d3f434-eddb-4bd0-97e0-84151a49d420}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="SSLSockets">
|
||||||
|
<UniqueIdentifier>{945cbc89-8697-4fc7-8972-1e94618df936}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="SSLSockets\Header Files">
|
||||||
|
<UniqueIdentifier>{aacbaf1d-ecf9-4cd8-a748-ff96a2f113a8}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="SSLSockets\Source Files">
|
||||||
|
<UniqueIdentifier>{1eca506b-2ddc-43e8-be2d-d2218d6e46b9}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Mail">
|
||||||
|
<UniqueIdentifier>{0be91609-0b40-4f0a-a534-d869eacf28aa}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Mail\Header Files">
|
||||||
|
<UniqueIdentifier>{7630e880-e526-4c53-a456-0afebff3ee52}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Mail\Source Files">
|
||||||
|
<UniqueIdentifier>{377a0f28-f2ba-421a-bb23-cf90baa8e1fa}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="include\Poco\Net\AcceptCertificateHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\CertificateHandlerFactory.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\CertificateHandlerFactoryMgr.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\ConsoleCertificateHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\Context.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\InvalidCertificateHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\KeyConsoleHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\KeyFileHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\NetSSL.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyFactory.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyFactoryMgr.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyPassphraseHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\RejectCertificateHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\Session.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SSLException.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SSLManager.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\Utility.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\VerificationErrorArgs.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\X509Certificate.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSClientSession.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSSessionInstantiator.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSStreamFactory.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureServerSocket.h">
|
||||||
|
<Filter>SSLSockets\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureServerSocketImpl.h">
|
||||||
|
<Filter>SSLSockets\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureSocketImpl.h">
|
||||||
|
<Filter>SSLSockets\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureStreamSocket.h">
|
||||||
|
<Filter>SSLSockets\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureStreamSocketImpl.h">
|
||||||
|
<Filter>SSLSockets\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureSMTPClientSession.h">
|
||||||
|
<Filter>Mail\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\AcceptCertificateHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\CertificateHandlerFactory.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\CertificateHandlerFactoryMgr.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\ConsoleCertificateHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Context.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\InvalidCertificateHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\KeyConsoleHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\KeyFileHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\PrivateKeyFactory.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\PrivateKeyFactoryMgr.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\PrivateKeyPassphraseHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\RejectCertificateHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Session.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SSLException.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SSLManager.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Utility.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\VerificationErrorArgs.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\X509Certificate.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSClientSession.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSSessionInstantiator.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSStreamFactory.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureServerSocket.cpp">
|
||||||
|
<Filter>SSLSockets\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureServerSocketImpl.cpp">
|
||||||
|
<Filter>SSLSockets\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureSocketImpl.cpp">
|
||||||
|
<Filter>SSLSockets\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureStreamSocket.cpp">
|
||||||
|
<Filter>SSLSockets\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureStreamSocketImpl.cpp">
|
||||||
|
<Filter>SSLSockets\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureSMTPClientSession.cpp">
|
||||||
|
<Filter>Mail\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
3
NetSSL_OpenSSL/NetSSL_OpenSSL_vs100.vcxproj.user
Normal file
3
NetSSL_OpenSSL/NetSSL_OpenSSL_vs100.vcxproj.user
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
60
NetSSL_OpenSSL/NetSSL_OpenSSL_x64_vs100.sln
Normal file
60
NetSSL_OpenSSL/NetSSL_OpenSSL_x64_vs100.sln
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
|
# Visual Studio 2010
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetSSL_OpenSSL", "NetSSL_OpenSSL_x64_vs100.vcxproj", "{5AECC55E-A469-11DA-8DA6-005056C00008}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_x64_vs100.vcxproj", "{B2B88092-5BCE-4AC0-941E-88167138B4A7}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008} = {5AECC55E-A469-11DA-8DA6-005056C00008}
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
debug_shared|x64 = debug_shared|x64
|
||||||
|
debug_static_md|x64 = debug_static_md|x64
|
||||||
|
debug_static_mt|x64 = debug_static_mt|x64
|
||||||
|
release_shared|x64 = release_shared|x64
|
||||||
|
release_static_md|x64 = release_static_md|x64
|
||||||
|
release_static_mt|x64 = release_static_mt|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_shared|x64.ActiveCfg = debug_shared|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_shared|x64.Build.0 = debug_shared|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_shared|x64.Deploy.0 = debug_shared|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_md|x64.Build.0 = debug_static_md|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_md|x64.Deploy.0 = debug_static_md|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_shared|x64.ActiveCfg = release_shared|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_shared|x64.Build.0 = release_shared|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_shared|x64.Deploy.0 = release_shared|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_md|x64.ActiveCfg = release_static_md|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_md|x64.Build.0 = release_static_md|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_md|x64.Deploy.0 = release_static_md|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_mt|x64.Build.0 = release_static_mt|x64
|
||||||
|
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static_mt|x64.Deploy.0 = release_static_mt|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_shared|x64.ActiveCfg = debug_shared|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_shared|x64.Build.0 = debug_shared|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_shared|x64.Deploy.0 = debug_shared|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_md|x64.Build.0 = debug_static_md|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_md|x64.Deploy.0 = debug_static_md|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_shared|x64.ActiveCfg = release_shared|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_shared|x64.Build.0 = release_shared|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_shared|x64.Deploy.0 = release_shared|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_md|x64.ActiveCfg = release_static_md|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_md|x64.Build.0 = release_static_md|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_md|x64.Deploy.0 = release_static_md|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_mt|x64.Build.0 = release_static_mt|x64
|
||||||
|
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static_mt|x64.Deploy.0 = release_static_mt|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
328
NetSSL_OpenSSL/NetSSL_OpenSSL_x64_vs100.vcxproj
Normal file
328
NetSSL_OpenSSL/NetSSL_OpenSSL_x64_vs100.vcxproj
Normal file
@@ -0,0 +1,328 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="debug_shared|x64">
|
||||||
|
<Configuration>debug_shared</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_md|x64">
|
||||||
|
<Configuration>debug_static_md</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_mt|x64">
|
||||||
|
<Configuration>debug_static_mt</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_shared|x64">
|
||||||
|
<Configuration>release_shared</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_md|x64">
|
||||||
|
<Configuration>release_static_md</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_mt|x64">
|
||||||
|
<Configuration>release_static_mt</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectName>NetSSL_OpenSSL</ProjectName>
|
||||||
|
<ProjectGuid>{5AECC55E-A469-11DA-8DA6-005056C00008}</ProjectGuid>
|
||||||
|
<RootNamespace>NetSSL_OpenSSL</RootNamespace>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
|
||||||
|
<ImportGroup Label="ExtensionSettings"/>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros"/>
|
||||||
|
<PropertyGroup>
|
||||||
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">..\bin64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">..\bin64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">..\lib64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">..\lib64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">..\lib64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">..\lib64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">PocoNetSSL64d</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">PocoNetSSLmdd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">PocoNetSSLmtd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">PocoNetSSL64</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">PocoNetSSLmd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">PocoNetSSLmt</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NetSSL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>..\bin64\PocoNetSSL64d.dll</OutputFile>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>..\bin64\PocoNetSSL64d.pdb</ProgramDatabaseFile>
|
||||||
|
<AdditionalLibraryDirectories>..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<ImportLibrary>..\lib64\PocoNetSSLd.lib</ImportLibrary>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;NetSSL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>..\bin64\PocoNetSSL64.dll</OutputFile>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<ImportLibrary>..\lib64\PocoNetSSL.lib</ImportLibrary>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<ProgramDataBaseFileName>..\lib64\PocoNetSSLmtd.pdb</ProgramDataBaseFileName>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Lib>
|
||||||
|
<OutputFile>..\lib64\PocoNetSSLmtd.lib</OutputFile>
|
||||||
|
</Lib>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Lib>
|
||||||
|
<OutputFile>..\lib64\PocoNetSSLmt.lib</OutputFile>
|
||||||
|
</Lib>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<ProgramDataBaseFileName>..\lib64\PocoNetSSLmdd.pdb</ProgramDataBaseFileName>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Lib>
|
||||||
|
<OutputFile>..\lib64\PocoNetSSLmdd.lib</OutputFile>
|
||||||
|
</Lib>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\Foundation\include;..\Net\include;..\Util\include;..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Lib>
|
||||||
|
<OutputFile>..\lib64\PocoNetSSLmd.lib</OutputFile>
|
||||||
|
</Lib>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="include\Poco\Net\AcceptCertificateHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\CertificateHandlerFactory.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\CertificateHandlerFactoryMgr.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\ConsoleCertificateHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\Context.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\InvalidCertificateHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\KeyConsoleHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\KeyFileHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\NetSSL.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyFactory.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyFactoryMgr.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyPassphraseHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\RejectCertificateHandler.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\Session.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SSLException.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SSLManager.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\Utility.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\VerificationErrorArgs.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\X509Certificate.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSClientSession.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSSessionInstantiator.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSStreamFactory.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureServerSocket.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureServerSocketImpl.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureSocketImpl.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureStreamSocket.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureStreamSocketImpl.h"/>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureSMTPClientSession.h"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\AcceptCertificateHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\CertificateHandlerFactory.cpp"/>
|
||||||
|
<ClCompile Include="src\CertificateHandlerFactoryMgr.cpp"/>
|
||||||
|
<ClCompile Include="src\ConsoleCertificateHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\Context.cpp"/>
|
||||||
|
<ClCompile Include="src\InvalidCertificateHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\KeyConsoleHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\KeyFileHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\PrivateKeyFactory.cpp"/>
|
||||||
|
<ClCompile Include="src\PrivateKeyFactoryMgr.cpp"/>
|
||||||
|
<ClCompile Include="src\PrivateKeyPassphraseHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\RejectCertificateHandler.cpp"/>
|
||||||
|
<ClCompile Include="src\Session.cpp"/>
|
||||||
|
<ClCompile Include="src\SSLException.cpp"/>
|
||||||
|
<ClCompile Include="src\SSLManager.cpp"/>
|
||||||
|
<ClCompile Include="src\Utility.cpp"/>
|
||||||
|
<ClCompile Include="src\VerificationErrorArgs.cpp"/>
|
||||||
|
<ClCompile Include="src\X509Certificate.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSClientSession.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSSessionInstantiator.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSStreamFactory.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureServerSocket.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureServerSocketImpl.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureSocketImpl.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureStreamSocket.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureStreamSocketImpl.cpp"/>
|
||||||
|
<ClCompile Include="src\SecureSMTPClientSession.cpp"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
|
||||||
|
<ImportGroup Label="ExtensionTargets"/>
|
||||||
|
</Project>
|
210
NetSSL_OpenSSL/NetSSL_OpenSSL_x64_vs100.vcxproj.filters
Normal file
210
NetSSL_OpenSSL/NetSSL_OpenSSL_x64_vs100.vcxproj.filters
Normal file
@@ -0,0 +1,210 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="SSLCore">
|
||||||
|
<UniqueIdentifier>{d9eaf0d6-f474-4ee8-aca5-32b62781b273}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="SSLCore\Header Files">
|
||||||
|
<UniqueIdentifier>{2998d636-8208-443f-be6d-13715d6203eb}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="SSLCore\Source Files">
|
||||||
|
<UniqueIdentifier>{1934c0e0-1d82-426d-a11e-581ea7ce5530}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient">
|
||||||
|
<UniqueIdentifier>{affd39f4-c370-4ba3-b1f1-9b7881bbe432}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient\Header Files">
|
||||||
|
<UniqueIdentifier>{7e2fce43-24c5-4d04-a1ec-a572a20702fe}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient\Source Files">
|
||||||
|
<UniqueIdentifier>{70a55b6d-855e-4e34-931f-2b3d2a5a66bf}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="SSLSockets">
|
||||||
|
<UniqueIdentifier>{4d42ad9b-28fa-46d0-bba8-9c61d26a2715}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="SSLSockets\Header Files">
|
||||||
|
<UniqueIdentifier>{548fa4c8-2205-48cb-ac60-ab525fadcd72}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="SSLSockets\Source Files">
|
||||||
|
<UniqueIdentifier>{fb31cd98-5924-4db5-889a-49a91b53c5e0}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Mail">
|
||||||
|
<UniqueIdentifier>{3dbb15f4-2822-47e4-8a2b-0da5c4b567a5}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Mail\Header Files">
|
||||||
|
<UniqueIdentifier>{235da22e-e34e-4ac2-a809-0b8789ead1c4}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Mail\Source Files">
|
||||||
|
<UniqueIdentifier>{eee01a7c-24b9-42a3-9151-b6e909f68c00}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="include\Poco\Net\AcceptCertificateHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\CertificateHandlerFactory.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\CertificateHandlerFactoryMgr.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\ConsoleCertificateHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\Context.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\InvalidCertificateHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\KeyConsoleHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\KeyFileHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\NetSSL.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyFactory.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyFactoryMgr.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\PrivateKeyPassphraseHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\RejectCertificateHandler.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\Session.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SSLException.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SSLManager.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\Utility.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\VerificationErrorArgs.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\X509Certificate.h">
|
||||||
|
<Filter>SSLCore\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSClientSession.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSSessionInstantiator.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\HTTPSStreamFactory.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureServerSocket.h">
|
||||||
|
<Filter>SSLSockets\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureServerSocketImpl.h">
|
||||||
|
<Filter>SSLSockets\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureSocketImpl.h">
|
||||||
|
<Filter>SSLSockets\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureStreamSocket.h">
|
||||||
|
<Filter>SSLSockets\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureStreamSocketImpl.h">
|
||||||
|
<Filter>SSLSockets\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\Poco\Net\SecureSMTPClientSession.h">
|
||||||
|
<Filter>Mail\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\AcceptCertificateHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\CertificateHandlerFactory.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\CertificateHandlerFactoryMgr.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\ConsoleCertificateHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Context.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\InvalidCertificateHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\KeyConsoleHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\KeyFileHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\PrivateKeyFactory.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\PrivateKeyFactoryMgr.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\PrivateKeyPassphraseHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\RejectCertificateHandler.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Session.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SSLException.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SSLManager.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\Utility.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\VerificationErrorArgs.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\X509Certificate.cpp">
|
||||||
|
<Filter>SSLCore\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSClientSession.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSSessionInstantiator.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSStreamFactory.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureServerSocket.cpp">
|
||||||
|
<Filter>SSLSockets\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureServerSocketImpl.cpp">
|
||||||
|
<Filter>SSLSockets\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureSocketImpl.cpp">
|
||||||
|
<Filter>SSLSockets\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureStreamSocket.cpp">
|
||||||
|
<Filter>SSLSockets\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureStreamSocketImpl.cpp">
|
||||||
|
<Filter>SSLSockets\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\SecureSMTPClientSession.cpp">
|
||||||
|
<Filter>Mail\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
3
NetSSL_OpenSSL/NetSSL_OpenSSL_x64_vs100.vcxproj.user
Normal file
3
NetSSL_OpenSSL/NetSSL_OpenSSL_x64_vs100.vcxproj.user
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
@@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
// Definition of the Context class.
|
// Definition of the Context class.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@@ -41,9 +41,13 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Poco/Net/NetSSL.h"
|
#include "Poco/Net/NetSSL.h"
|
||||||
|
#include "Poco/Net/SocketDefs.h"
|
||||||
|
#include "Poco/Crypto/X509Certificate.h"
|
||||||
|
#include "Poco/Crypto/RSAKey.h"
|
||||||
#include "Poco/RefCountedObject.h"
|
#include "Poco/RefCountedObject.h"
|
||||||
#include "Poco/AutoPtr.h"
|
#include "Poco/AutoPtr.h"
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
@@ -56,6 +60,9 @@ class NetSSL_API Context: public Poco::RefCountedObject
|
|||||||
/// verification mode and the location of certificates
|
/// verification mode and the location of certificates
|
||||||
/// and private key files, as well as the list of
|
/// and private key files, as well as the list of
|
||||||
/// supported ciphers.
|
/// supported ciphers.
|
||||||
|
///
|
||||||
|
/// The Context class is also used to control
|
||||||
|
/// SSL session caching on the server and client side.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef Poco::AutoPtr<Context> Ptr;
|
typedef Poco::AutoPtr<Context> Ptr;
|
||||||
@@ -88,12 +95,12 @@ public:
|
|||||||
/// immediately terminated with an alert message containing the
|
/// immediately terminated with an alert message containing the
|
||||||
/// reason for the verification failure.
|
/// reason for the verification failure.
|
||||||
|
|
||||||
VERIFY_STRICT = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
|
VERIFY_STRICT = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
|
||||||
/// Server: If the client did not return a certificate, the TLS/SSL
|
/// Server: If the client did not return a certificate, the TLS/SSL
|
||||||
/// handshake is immediately terminated with a handshake failure
|
/// handshake is immediately terminated with a handshake failure
|
||||||
/// alert. This flag must be used together with SSL_VERIFY_PEER.
|
/// alert. This flag must be used together with SSL_VERIFY_PEER.
|
||||||
///
|
///
|
||||||
/// Client: Same as VERIFY_RELAXED.
|
/// Client: Same as VERIFY_RELAXED.
|
||||||
|
|
||||||
VERIFY_ONCE = SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE
|
VERIFY_ONCE = SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE
|
||||||
/// Server: Only request a client certificate on the initial
|
/// Server: Only request a client certificate on the initial
|
||||||
@@ -125,26 +132,155 @@ public:
|
|||||||
/// are used (see loadDefaultCAs).
|
/// are used (see loadDefaultCAs).
|
||||||
/// * verificationMode specifies whether and how peer certificates are validated.
|
/// * verificationMode specifies whether and how peer certificates are validated.
|
||||||
/// * verificationDepth sets the upper limit for verification chain sizes. Verification
|
/// * verificationDepth sets the upper limit for verification chain sizes. Verification
|
||||||
/// will fail if a certificate chain larger than this is encountered.
|
/// will fail if a certificate chain larger than this is encountered.
|
||||||
/// * loadDefaultCAs specifies wheter the builtin CA certificates from OpenSSL are used.
|
/// * loadDefaultCAs specifies wheter the builtin CA certificates from OpenSSL are used.
|
||||||
/// * cipherList specifies the supported ciphers in OpenSSL notation.
|
/// * cipherList specifies the supported ciphers in OpenSSL notation.
|
||||||
|
///
|
||||||
|
/// Note: If the private key is protected by a passphrase, a PrivateKeyPassphraseHandler
|
||||||
|
/// must have been setup with the SSLManager, or the SSLManager's PrivateKeyPassphraseRequired
|
||||||
|
/// event must be handled.
|
||||||
|
|
||||||
~Context();
|
Context(
|
||||||
/// Destroys the Context.
|
Usage usage,
|
||||||
|
const std::string& caLocation,
|
||||||
|
VerificationMode verificationMode = VERIFY_RELAXED,
|
||||||
|
int verificationDepth = 9,
|
||||||
|
bool loadDefaultCAs = false,
|
||||||
|
const std::string& cipherList = "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
||||||
|
/// Creates a Context.
|
||||||
|
///
|
||||||
|
/// * usage specifies whether the context is used by a client or server.
|
||||||
|
/// * caLocation contains the path to the file or directory containing the
|
||||||
|
/// CA/root certificates. Can be empty if the OpenSSL builtin CA certificates
|
||||||
|
/// are used (see loadDefaultCAs).
|
||||||
|
/// * verificationMode specifies whether and how peer certificates are validated.
|
||||||
|
/// * verificationDepth sets the upper limit for verification chain sizes. Verification
|
||||||
|
/// will fail if a certificate chain larger than this is encountered.
|
||||||
|
/// * loadDefaultCAs specifies wheter the builtin CA certificates from OpenSSL are used.
|
||||||
|
/// * cipherList specifies the supported ciphers in OpenSSL notation.
|
||||||
|
///
|
||||||
|
/// Note that a private key and/or certificate must be specified with
|
||||||
|
/// usePrivateKey()/useCertificate() before the Context can be used.
|
||||||
|
|
||||||
SSL_CTX* sslContext() const;
|
~Context();
|
||||||
/// Returns the underlying OpenSSL SSL Context object.
|
/// Destroys the Context.
|
||||||
|
|
||||||
|
void useCertificate(const Poco::Crypto::X509Certificate& certificate);
|
||||||
|
/// Sets the certificate to be used by the Context.
|
||||||
|
///
|
||||||
|
/// To set-up a complete certificate chain, it might be
|
||||||
|
/// necessary to call addChainCertificate() to specify
|
||||||
|
/// additional certificates.
|
||||||
|
///
|
||||||
|
/// Note that useCertificate() must always be called before
|
||||||
|
/// usePrivateKey().
|
||||||
|
|
||||||
|
void addChainCertificate(const Poco::Crypto::X509Certificate& certificate);
|
||||||
|
/// Adds a certificate for certificate chain validation.
|
||||||
|
|
||||||
|
void usePrivateKey(const Poco::Crypto::RSAKey& key);
|
||||||
|
/// Sets the private key to be used by the Context.
|
||||||
|
///
|
||||||
|
/// Note that useCertificate() must always be called before
|
||||||
|
/// usePrivateKey().
|
||||||
|
///
|
||||||
|
/// Note: If the private key is protected by a passphrase, a PrivateKeyPassphraseHandler
|
||||||
|
/// must have been setup with the SSLManager, or the SSLManager's PrivateKeyPassphraseRequired
|
||||||
|
/// event must be handled.
|
||||||
|
|
||||||
|
SSL_CTX* sslContext() const;
|
||||||
|
/// Returns the underlying OpenSSL SSL Context object.
|
||||||
|
|
||||||
Usage usage() const;
|
Usage usage() const;
|
||||||
/// Returns whether the context is for use by a client or by a server.
|
/// Returns whether the context is for use by a client or by a server.
|
||||||
|
|
||||||
Context::VerificationMode verificationMode() const;
|
Context::VerificationMode verificationMode() const;
|
||||||
/// Returns the verification mode.
|
/// Returns the verification mode.
|
||||||
|
|
||||||
|
void enableSessionCache(bool flag = true);
|
||||||
|
/// Enable or disable SSL/TLS session caching.
|
||||||
|
/// For session caching to work, it must be enabled
|
||||||
|
/// on the server, as well as on the client side.
|
||||||
|
///
|
||||||
|
/// The default is disabled session caching.
|
||||||
|
///
|
||||||
|
/// To enable session caching on the server side, use the
|
||||||
|
/// two-argument version of this method to specify
|
||||||
|
/// a session ID context.
|
||||||
|
|
||||||
|
void enableSessionCache(bool flag, const std::string& sessionIdContext);
|
||||||
|
/// Enables or disables SSL/TLS session caching on the server.
|
||||||
|
/// For session caching to work, it must be enabled
|
||||||
|
/// on the server, as well as on the client side.
|
||||||
|
///
|
||||||
|
/// SessionIdContext contains the application's unique
|
||||||
|
/// session ID context, which becomes part of each
|
||||||
|
/// session identifier generated by the server within this
|
||||||
|
/// context. SessionIdContext can be an arbitrary sequence
|
||||||
|
/// of bytes with a maximum length of SSL_MAX_SSL_SESSION_ID_LENGTH.
|
||||||
|
///
|
||||||
|
/// A non-empty sessionIdContext should be specified even if
|
||||||
|
/// session caching is disabled to avoid problems with clients
|
||||||
|
/// requesting to reuse a session (e.g. Firefox 3.6).
|
||||||
|
///
|
||||||
|
/// This method may only be called on SERVER_USE Context objects.
|
||||||
|
|
||||||
|
bool sessionCacheEnabled() const;
|
||||||
|
/// Returns true iff the session cache is enabled.
|
||||||
|
|
||||||
|
void setSessionCacheSize(std::size_t size);
|
||||||
|
/// Sets the maximum size of the server session cache, in number of
|
||||||
|
/// sessions. The default size (according to OpenSSL documentation)
|
||||||
|
/// is 1024*20, which may be too large for many applications,
|
||||||
|
/// especially on embedded platforms with limited memory.
|
||||||
|
///
|
||||||
|
/// Specifying a size of 0 will set an unlimited cache size.
|
||||||
|
///
|
||||||
|
/// This method may only be called on SERVER_USE Context objets.
|
||||||
|
|
||||||
|
std::size_t getSessionCacheSize() const;
|
||||||
|
/// Returns the current maximum size of the server session cache.
|
||||||
|
///
|
||||||
|
/// This method may only be called on SERVER_USE Context objets.
|
||||||
|
|
||||||
|
void setSessionTimeout(long seconds);
|
||||||
|
/// Sets the timeout (in seconds) of cached sessions on the server.
|
||||||
|
/// A cached session will be removed from the cache if it has
|
||||||
|
/// not been used for the given number of seconds.
|
||||||
|
///
|
||||||
|
/// This method may only be called on SERVER_USE Context objets.
|
||||||
|
|
||||||
|
long getSessionTimeout() const;
|
||||||
|
/// Returns the timeout (in seconds) of cached sessions on the server.
|
||||||
|
///
|
||||||
|
/// This method may only be called on SERVER_USE Context objets.
|
||||||
|
|
||||||
|
void flushSessionCache();
|
||||||
|
/// Flushes the SSL session cache on the server.
|
||||||
|
///
|
||||||
|
/// This method may only be called on SERVER_USE Context objets.
|
||||||
|
|
||||||
|
void enableExtendedCertificateVerification(bool flag = true);
|
||||||
|
/// Enable or disable the automatic post-connection
|
||||||
|
/// extended certificate verification.
|
||||||
|
///
|
||||||
|
/// See X509Certificate::verify() for more information.
|
||||||
|
|
||||||
|
bool extendedCertificateVerificationEnabled() const;
|
||||||
|
/// Returns true iff automatic extended certificate
|
||||||
|
/// verification is enabled.
|
||||||
|
|
||||||
|
void disableStatelessSessionResumption();
|
||||||
|
/// Newer versions of OpenSSL support RFC 4507 tickets for stateless
|
||||||
|
/// session resumption.
|
||||||
|
///
|
||||||
|
/// The feature can be disabled by calling this method.
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Usage _usage;
|
Usage _usage;
|
||||||
VerificationMode _mode;
|
VerificationMode _mode;
|
||||||
SSL_CTX* _pSSLContext;
|
SSL_CTX* _pSSLContext;
|
||||||
|
bool _extendedCertificateVerification;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -169,6 +305,12 @@ inline SSL_CTX* Context::sslContext() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool Context::extendedCertificateVerificationEnabled() const
|
||||||
|
{
|
||||||
|
return _extendedCertificateVerification;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
|
||||||
|
|
||||||
|
@@ -44,6 +44,7 @@
|
|||||||
#include "Poco/Net/Utility.h"
|
#include "Poco/Net/Utility.h"
|
||||||
#include "Poco/Net/HTTPClientSession.h"
|
#include "Poco/Net/HTTPClientSession.h"
|
||||||
#include "Poco/Net/Context.h"
|
#include "Poco/Net/Context.h"
|
||||||
|
#include "Poco/Net/Session.h"
|
||||||
#include "Poco/Net/X509Certificate.h"
|
#include "Poco/Net/X509Certificate.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -81,12 +82,17 @@ class NetSSL_API HTTPSClientSession: public HTTPClientSession
|
|||||||
///
|
///
|
||||||
/// Note that sending requests that neither contain a content length
|
/// Note that sending requests that neither contain a content length
|
||||||
/// field in the header nor are using chunked transfer encoding will
|
/// field in the header nor are using chunked transfer encoding will
|
||||||
/// result in a SSL protocol violation, as the framework shuts down
|
/// result in a SSL protocol violation, as the framework shuts down
|
||||||
/// the socket after sending the message body. No orderly SSL shutdown
|
/// the socket after sending the message body. No orderly SSL shutdown
|
||||||
/// will be performed in this case.
|
/// will be performed in this case.
|
||||||
|
///
|
||||||
|
/// If session caching has been enabled for the Context object passed
|
||||||
|
/// to the HTTPSClientSession, the HTTPSClientSession class will
|
||||||
|
/// attempt to reuse a previously obtained Session object in
|
||||||
|
/// case of a reconnect.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
HTTPS_PORT = 443
|
HTTPS_PORT = 443
|
||||||
};
|
};
|
||||||
@@ -96,38 +102,81 @@ public:
|
|||||||
|
|
||||||
explicit HTTPSClientSession(const SecureStreamSocket& socket);
|
explicit HTTPSClientSession(const SecureStreamSocket& socket);
|
||||||
/// Creates a HTTPSClientSession using the given socket.
|
/// Creates a HTTPSClientSession using the given socket.
|
||||||
/// The socket must not be connected. The session
|
/// The socket must not be connected. The session
|
||||||
/// takes ownership of the socket.
|
/// takes ownership of the socket.
|
||||||
|
|
||||||
HTTPSClientSession(const std::string& host, Poco::UInt16 port = HTTPS_PORT);
|
HTTPSClientSession(const SecureStreamSocket& socket, Session::Ptr pSession);
|
||||||
/// Creates a HTTPSClientSession using the given host and port.
|
/// Creates a HTTPSClientSession using the given socket.
|
||||||
|
/// The socket must not be connected. The session
|
||||||
|
/// takes ownership of the socket.
|
||||||
|
///
|
||||||
|
/// The given Session is reused, if possible (client session
|
||||||
|
/// caching is enabled for the given Context, and the server
|
||||||
|
/// agrees to reuse the session).
|
||||||
|
|
||||||
|
HTTPSClientSession(const std::string& host, Poco::UInt16 port = HTTPS_PORT);
|
||||||
|
/// Creates a HTTPSClientSession using the given host and port.
|
||||||
|
|
||||||
explicit HTTPSClientSession(Context::Ptr pContext);
|
explicit HTTPSClientSession(Context::Ptr pContext);
|
||||||
/// Creates an unconnected HTTPSClientSession, using the
|
/// Creates an unconnected HTTPSClientSession, using the
|
||||||
/// give SSL context.
|
/// give SSL context.
|
||||||
|
|
||||||
HTTPSClientSession(const std::string& host, Poco::UInt16 port, Context::Ptr pContext);
|
HTTPSClientSession(Context::Ptr pContext, Session::Ptr pSession);
|
||||||
/// Creates a HTTPSClientSession using the given host and port,
|
/// Creates an unconnected HTTPSClientSession, using the
|
||||||
/// using the given SSL context.
|
/// give SSL context.
|
||||||
|
///
|
||||||
|
/// The given Session is reused, if possible (client session
|
||||||
|
/// caching is enabled for the given Context, and the server
|
||||||
|
/// agrees to reuse the session).
|
||||||
|
|
||||||
~HTTPSClientSession();
|
HTTPSClientSession(const std::string& host, Poco::UInt16 port, Context::Ptr pContext);
|
||||||
/// Destroys the HTTPSClientSession and closes
|
/// Creates a HTTPSClientSession using the given host and port,
|
||||||
/// the underlying socket.
|
/// using the given SSL context.
|
||||||
|
|
||||||
X509Certificate serverCertificate();
|
HTTPSClientSession(const std::string& host, Poco::UInt16 port, Context::Ptr pContext, Session::Ptr pSession);
|
||||||
/// Returns the server's certificate.
|
/// Creates a HTTPSClientSession using the given host and port,
|
||||||
///
|
/// using the given SSL context.
|
||||||
/// The certificate is available after the first request has been sent.
|
///
|
||||||
|
/// The given Session is reused, if possible (client session
|
||||||
|
/// caching is enabled for the given Context, and the server
|
||||||
|
/// agrees to reuse the session).
|
||||||
|
|
||||||
|
~HTTPSClientSession();
|
||||||
|
/// Destroys the HTTPSClientSession and closes
|
||||||
|
/// the underlying socket.
|
||||||
|
|
||||||
|
bool secure() const;
|
||||||
|
/// Return true iff the session uses SSL or TLS,
|
||||||
|
/// or false otherwise.
|
||||||
|
|
||||||
|
X509Certificate serverCertificate();
|
||||||
|
/// Returns the server's certificate.
|
||||||
|
///
|
||||||
|
/// The certificate is available after the first request has been sent.
|
||||||
|
|
||||||
|
Session::Ptr sslSession();
|
||||||
|
/// Returns the SSL Session object for the current
|
||||||
|
/// connection, if session caching has been enabled for
|
||||||
|
/// the HTTPSClientSession's Context. A null pointer is
|
||||||
|
/// returned otherwise.
|
||||||
|
///
|
||||||
|
/// The Session object can be obtained after the first request has
|
||||||
|
/// been sent.
|
||||||
|
|
||||||
|
// HTTPSession
|
||||||
|
void abort();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void connect(const SocketAddress& address);
|
void connect(const SocketAddress& address);
|
||||||
std::string proxyRequestPrefix() const;
|
std::string proxyRequestPrefix() const;
|
||||||
|
void proxyAuthenticate(HTTPRequest& request);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HTTPSClientSession(const HTTPSClientSession&);
|
HTTPSClientSession(const HTTPSClientSession&);
|
||||||
HTTPSClientSession& operator = (const HTTPSClientSession&);
|
HTTPSClientSession& operator = (const HTTPSClientSession&);
|
||||||
|
|
||||||
Context::Ptr _pContext;
|
Context::Ptr _pContext;
|
||||||
|
Session::Ptr _pSession;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -57,13 +57,20 @@ public:
|
|||||||
HTTPSStreamFactory();
|
HTTPSStreamFactory();
|
||||||
/// Creates the HTTPSStreamFactory.
|
/// Creates the HTTPSStreamFactory.
|
||||||
|
|
||||||
HTTPSStreamFactory(const std::string& proxyHost, Poco::UInt16 proxyPort = HTTPSession::HTTP_PORT);
|
HTTPSStreamFactory(const std::string& proxyHost, Poco::UInt16 proxyPort = HTTPSession::HTTP_PORT);
|
||||||
/// Creates the HTTPSStreamFactory.
|
/// Creates the HTTPSStreamFactory.
|
||||||
///
|
///
|
||||||
/// HTTP connections will use the given proxy.
|
/// HTTPS connections will use the given proxy.
|
||||||
|
|
||||||
~HTTPSStreamFactory();
|
HTTPSStreamFactory(const std::string& proxyHost, Poco::UInt16 proxyPort, const std::string& proxyUsername, const std::string& proxyPassword);
|
||||||
/// Destroys the HTTPSStreamFactory.
|
/// Creates the HTTPSStreamFactory.
|
||||||
|
///
|
||||||
|
/// HTTPS connections will use the given proxy and
|
||||||
|
/// will be authorized against the proxy using Basic authentication
|
||||||
|
/// with the given proxyUsername and proxyPassword.
|
||||||
|
|
||||||
|
~HTTPSStreamFactory();
|
||||||
|
/// Destroys the HTTPSStreamFactory.
|
||||||
|
|
||||||
std::istream* open(const Poco::URI& uri);
|
std::istream* open(const Poco::URI& uri);
|
||||||
/// Creates and opens a HTTPS stream for the given URI.
|
/// Creates and opens a HTTPS stream for the given URI.
|
||||||
@@ -81,8 +88,10 @@ private:
|
|||||||
MAX_REDIRECTS = 10
|
MAX_REDIRECTS = 10
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string _proxyHost;
|
std::string _proxyHost;
|
||||||
Poco::UInt16 _proxyPort;
|
Poco::UInt16 _proxyPort;
|
||||||
|
std::string _proxyUsername;
|
||||||
|
std::string _proxyPassword;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -71,22 +71,39 @@
|
|||||||
// Automatically link NetSSL library.
|
// Automatically link NetSSL library.
|
||||||
//
|
//
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(NetSSL_EXPORTS)
|
#if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(NetSSL_EXPORTS)
|
||||||
#if defined(POCO_DLL)
|
#pragma comment(lib, "PocoNetSSL" POCO_LIB_SUFFIX)
|
||||||
#if defined(_DEBUG)
|
#endif
|
||||||
#pragma comment(lib, "PocoNetSSLd.lib")
|
|
||||||
#else
|
|
||||||
#pragma comment(lib, "PocoNetSSL.lib")
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#if defined(_DEBUG)
|
|
||||||
#pragma comment(lib, "PocoNetSSLmtd.lib")
|
|
||||||
#else
|
|
||||||
#pragma comment(lib, "PocoNetSSLmt.lib")
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
namespace Poco {
|
||||||
|
namespace Net {
|
||||||
|
|
||||||
|
|
||||||
|
void NetSSL_API initializeSSL();
|
||||||
|
/// Initialize the NetSSL library, as well as the underlying OpenSSL
|
||||||
|
/// libraries, by calling Poco::Crypto::OpenSSLInitializer::initialize().
|
||||||
|
///
|
||||||
|
/// Should be called before using any class from the NetSSL library.
|
||||||
|
/// The NetSSL will be initialized automatically, through
|
||||||
|
/// Poco::Crypto::OpenSSLInitializer instances or similar mechanisms
|
||||||
|
/// when creating Context or SSLManager instances.
|
||||||
|
/// However, it is recommended to call initializeSSL()
|
||||||
|
/// in any case at application startup.
|
||||||
|
///
|
||||||
|
/// Can be called multiple times; however, for every call to
|
||||||
|
/// initializeSSL(), a matching call to uninitializeSSL()
|
||||||
|
/// must be performed.
|
||||||
|
|
||||||
|
|
||||||
|
void NetSSL_API uninitializeSSL();
|
||||||
|
/// Uninitializes the NetSSL library by calling
|
||||||
|
/// Poco::Crypto::OpenSSLInitializer::uninitialize() and
|
||||||
|
/// shutting down the SSLManager.
|
||||||
|
|
||||||
|
|
||||||
|
} } // namespace Poco::Net
|
||||||
|
|
||||||
|
|
||||||
#endif // NetSSL_NetSSL_INCLUDED
|
#endif // NetSSL_NetSSL_INCLUDED
|
||||||
|
70
NetSSL_OpenSSL/include/Poco/Net/RejectCertificateHandler.h
Normal file
70
NetSSL_OpenSSL/include/Poco/Net/RejectCertificateHandler.h
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
//
|
||||||
|
// RejectCertificateHandler.h
|
||||||
|
//
|
||||||
|
// $Id: //poco/1.4/NetSSL_OpenSSL/include/Poco/Net/RejectCertificateHandler.h#1 $
|
||||||
|
//
|
||||||
|
// Library: NetSSL_OpenSSL
|
||||||
|
// Package: SSLCore
|
||||||
|
// Module: RejectCertificateHandler
|
||||||
|
//
|
||||||
|
// Definition of the RejectCertificateHandler class.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
|
// and Contributors.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
|
// obtaining a copy of the software and accompanying documentation covered by
|
||||||
|
// this license (the "Software") to use, reproduce, display, distribute,
|
||||||
|
// execute, and transmit the Software, and to prepare derivative works of the
|
||||||
|
// Software, and to permit third-parties to whom the Software is furnished to
|
||||||
|
// do so, all subject to the following:
|
||||||
|
//
|
||||||
|
// The copyright notices in the Software and this entire statement, including
|
||||||
|
// the above license grant, this restriction and the following disclaimer,
|
||||||
|
// must be included in all copies of the Software, in whole or in part, and
|
||||||
|
// all derivative works of the Software, unless such copies or derivative
|
||||||
|
// works are solely in the form of machine-executable object code generated by
|
||||||
|
// a source language processor.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||||
|
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||||
|
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||||
|
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NetSSL_RejectCertificateHandler_INCLUDED
|
||||||
|
#define NetSSL_RejectCertificateHandler_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
|
#include "Poco/Net/NetSSL.h"
|
||||||
|
#include "Poco/Net/InvalidCertificateHandler.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Poco {
|
||||||
|
namespace Net {
|
||||||
|
|
||||||
|
|
||||||
|
class NetSSL_API RejectCertificateHandler: public InvalidCertificateHandler
|
||||||
|
/// A RejectCertificateHandler is invoked whenever an error
|
||||||
|
/// occurs verifying the certificate. It always rejects
|
||||||
|
/// the certificate.
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RejectCertificateHandler(bool handleErrorsOnServerSide);
|
||||||
|
/// Creates the RejectCertificateHandler
|
||||||
|
|
||||||
|
virtual ~RejectCertificateHandler();
|
||||||
|
/// Destroys the RejectCertificateHandler.
|
||||||
|
|
||||||
|
void onInvalidCertificate(const void* pSender, VerificationErrorArgs& errorCert);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} } // namespace Poco::Net
|
||||||
|
|
||||||
|
|
||||||
|
#endif // NetSSL_RejectCertificateHandler_INCLUDED
|
@@ -52,6 +52,7 @@ POCO_DECLARE_EXCEPTION(NetSSL_API, SSLException, NetException)
|
|||||||
POCO_DECLARE_EXCEPTION(NetSSL_API, SSLContextException, SSLException)
|
POCO_DECLARE_EXCEPTION(NetSSL_API, SSLContextException, SSLException)
|
||||||
POCO_DECLARE_EXCEPTION(NetSSL_API, InvalidCertificateException, SSLException)
|
POCO_DECLARE_EXCEPTION(NetSSL_API, InvalidCertificateException, SSLException)
|
||||||
POCO_DECLARE_EXCEPTION(NetSSL_API, CertificateValidationException, SSLException)
|
POCO_DECLARE_EXCEPTION(NetSSL_API, CertificateValidationException, SSLException)
|
||||||
|
POCO_DECLARE_EXCEPTION(NetSSL_API, SSLConnectionUnexpectedlyClosedException, SSLException)
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
// Definition of the SSLManager class.
|
// Definition of the SSLManager class.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@@ -46,9 +46,14 @@
|
|||||||
#include "Poco/Net/PrivateKeyFactoryMgr.h"
|
#include "Poco/Net/PrivateKeyFactoryMgr.h"
|
||||||
#include "Poco/Net/CertificateHandlerFactoryMgr.h"
|
#include "Poco/Net/CertificateHandlerFactoryMgr.h"
|
||||||
#include "Poco/Net/InvalidCertificateHandler.h"
|
#include "Poco/Net/InvalidCertificateHandler.h"
|
||||||
|
#include "Poco/Util/AbstractConfiguration.h"
|
||||||
#include "Poco/BasicEvent.h"
|
#include "Poco/BasicEvent.h"
|
||||||
#include "Poco/SharedPtr.h"
|
#include "Poco/SharedPtr.h"
|
||||||
|
#include "Poco/Mutex.h"
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
#ifdef OPENSSL_FIPS
|
||||||
|
#include <openssl/fips.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
@@ -59,112 +64,175 @@ class Context;
|
|||||||
|
|
||||||
|
|
||||||
class NetSSL_API SSLManager
|
class NetSSL_API SSLManager
|
||||||
/// SSLManager is a singleton for holding the default server/client
|
/// SSLManager is a singleton for holding the default server/client
|
||||||
/// Context and PrivateKeyPassphraseHandler.
|
/// Context and handling callbacks for certificate verification errors
|
||||||
///
|
/// and private key passphrases.
|
||||||
/// Either initialize via Poco::Util::Application or via the
|
///
|
||||||
/// initialize methods of the singleton. Note that the latter initialization must happen very early
|
/// Proper initialization of SSLManager is critical.
|
||||||
/// during program startup before somebody calls defaultClientContext()/defaultServerContext()
|
///
|
||||||
/// or any of the passPhraseHandler methods (which tries to auto-initialize
|
/// SSLManager can be initialized manually, by calling initializeServer()
|
||||||
/// the context and passphrase handler based on an Poco::Util::Application configuration).
|
/// and/or initializeClient(), or intialization can be automatic. In the latter
|
||||||
///
|
/// case, a Poco::Util::Application instance must be available and the required
|
||||||
/// An exemplary documentation which sets either the server or client defaultcontext and creates a PrivateKeyPassphraseHandler
|
/// configuration properties must be set (see below).
|
||||||
/// that reads the password from the XML file looks like this:
|
///
|
||||||
///
|
/// Note that manual intialization must happen very early in the application,
|
||||||
/// <AppConfig>
|
/// before defaultClientContext() or defaultServerContext() are called.
|
||||||
/// <openSSL>
|
///
|
||||||
|
/// If defaultClientContext() and defaultServerContext() are never called
|
||||||
|
/// in an application, initialization of SSLManager can be omitted.
|
||||||
|
/// However, in this case, delegates for the ServerVerificationError,
|
||||||
|
/// ClientVerificationError and PrivateKeyPassphraseRequired events
|
||||||
|
/// must be registered.
|
||||||
|
///
|
||||||
|
/// An exemplary documentation which sets either the server or client default context and creates
|
||||||
|
/// a PrivateKeyPassphraseHandler that reads the password from the XML file looks like this:
|
||||||
|
///
|
||||||
|
/// <AppConfig>
|
||||||
|
/// <openSSL>
|
||||||
/// <server|client>
|
/// <server|client>
|
||||||
/// <privateKeyFile>mycert.key</privateKeyFile>
|
/// <privateKeyFile>mycert.key</privateKeyFile>
|
||||||
/// <certificateFile>mycert.crt</certificateFile>
|
/// <certificateFile>mycert.crt</certificateFile>
|
||||||
/// <caConfig>rootcert.pem</caConfig>
|
/// <caConfig>rootcert.pem</caConfig>
|
||||||
/// <verificationMode>relaxed</verificationMode>
|
/// <verificationMode>none|relaxed|strict|once</verificationMode>
|
||||||
/// <verificationDepth>9</verificationDepth>
|
/// <verificationDepth>1..9</verificationDepth>
|
||||||
/// <loadDefaultCAFile>true</loadDefaultCAFile>
|
/// <loadDefaultCAFile>true|false</loadDefaultCAFile>
|
||||||
/// <cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList>
|
/// <cipherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cipherList>
|
||||||
/// <privateKeyPassphraseHandler>
|
/// <privateKeyPassphraseHandler>
|
||||||
/// <name>KeyFileHandler</name>
|
/// <name>KeyFileHandler</name>
|
||||||
/// <options>
|
/// <options>
|
||||||
/// <password>test</password>
|
/// <password>test</password>
|
||||||
/// </options>
|
/// </options>
|
||||||
/// </privateKeyPassphraseHandler>
|
/// </privateKeyPassphraseHandler>
|
||||||
/// <invalidCertificateHandler>
|
/// <invalidCertificateHandler>
|
||||||
/// <name>ConsoleCertificateHandler</name>
|
/// <name>ConsoleCertificateHandler</name>
|
||||||
/// <options>
|
/// </invalidCertificateHandler>
|
||||||
/// </options>
|
/// <cacheSessions>true|false</cacheSessions>
|
||||||
/// </invalidCertificateHandler>
|
/// <sessionIdContext>someString</sessionIdContext> <!-- server only -->
|
||||||
/// </server|client>
|
/// <sessionCacheSize>0..n</sessionCacheSize> <!-- server only -->
|
||||||
/// </openSSL>
|
/// <sessionTimeout>0..n</sessionTimeout> <!-- server only -->
|
||||||
/// </AppConfig>
|
/// <extendedVerification>true|false</extendedVerification>
|
||||||
|
/// </server|client>
|
||||||
|
/// <fips>false</fips>
|
||||||
|
/// </openSSL>
|
||||||
|
/// </AppConfig>
|
||||||
|
///
|
||||||
|
/// Following is a list of supported configuration properties. Property names must always
|
||||||
|
/// be prefixed with openSSL.server or openSSL.client. Some properties are only supported
|
||||||
|
/// for servers.
|
||||||
|
///
|
||||||
|
/// - privateKeyFile (string): The path to the file containing the private key for the certificate
|
||||||
|
/// in PEM format (or containing both the private key and the certificate).
|
||||||
|
/// - certificateFile (string): The Path to the file containing the server's or client's certificate
|
||||||
|
/// in PEM format. Can be omitted if the the file given in privateKeyFile contains the certificate as well.
|
||||||
|
/// - caConfig (string): The path to the file or directory containing the trusted root certificates.
|
||||||
|
/// - verificationMode (string): Specifies whether and how peer certificates are validated (see
|
||||||
|
/// the Context class for details). Valid values are none, relaxed, strict, once.
|
||||||
|
/// - verificationDepth (integer, 1-9): Sets the upper limit for verification chain sizes. Verification
|
||||||
|
/// will fail if a certificate chain larger than this is encountered.
|
||||||
|
/// - loadDefaultCAFile (boolean): Specifies wheter the builtin CA certificates from OpenSSL are used.
|
||||||
|
/// - cipherList (string): Specifies the supported ciphers in OpenSSL notation
|
||||||
|
/// (e.g. "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH").
|
||||||
|
/// - privateKeyPassphraseHandler.name (string): The name of the class (subclass of PrivateKeyPassphraseHandler)
|
||||||
|
/// used for obtaining the passphrase for accessing the private key.
|
||||||
|
/// - privateKeyPassphraseHandler.options.password (string): The password to be used by KeyFileHandler.
|
||||||
|
/// - invalidCertificateHandler.name: The name of the class (subclass of CertificateHandler)
|
||||||
|
/// used for confirming invalid certificates.
|
||||||
|
/// - cacheSessions (boolean): Enables or disables session caching.
|
||||||
|
/// - sessionIdContext (string): contains the application's unique session ID context, which becomes
|
||||||
|
/// part of each session identifier generated by the server. Can be an arbitrary sequence
|
||||||
|
/// of bytes with a maximum length of SSL_MAX_SSL_SESSION_ID_LENGTH. Should be specified
|
||||||
|
/// for a server to enable session caching. Should be specified even if session caching
|
||||||
|
/// is disabled to avoid problems with clients that request session caching (e.g. Firefox 3.6).
|
||||||
|
/// If not specified, defaults to ${application.name}.
|
||||||
|
/// - sessionCacheSize (integer): Sets the maximum size of the server session cache, in number of
|
||||||
|
/// sessions. The default size (according to OpenSSL documentation) is 1024*20, which may be too
|
||||||
|
/// large for many applications, especially on embedded platforms with limited memory.
|
||||||
|
/// Specifying a size of 0 will set an unlimited cache size.
|
||||||
|
/// - sessionTimeout (integer): Sets the timeout (in seconds) of cached sessions on the server.
|
||||||
|
/// - extendedVerification (boolean): Enable or disable the automatic post-connection
|
||||||
|
/// extended certificate verification.
|
||||||
|
/// - fips: Enable or disable OpenSSL FIPS mode. Only supported if the OpenSSL version
|
||||||
|
/// that this library is built against supports FIPS mode.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef Poco::SharedPtr<PrivateKeyPassphraseHandler> PrivateKeyPassphraseHandlerPtr;
|
typedef Poco::SharedPtr<PrivateKeyPassphraseHandler> PrivateKeyPassphraseHandlerPtr;
|
||||||
typedef Poco::SharedPtr<InvalidCertificateHandler> InvalidCertificateHandlerPtr;
|
typedef Poco::SharedPtr<InvalidCertificateHandler> InvalidCertificateHandlerPtr;
|
||||||
|
|
||||||
Poco::BasicEvent<VerificationErrorArgs> ServerVerificationError;
|
Poco::BasicEvent<VerificationErrorArgs> ServerVerificationError;
|
||||||
/// Thrown whenever a certificate error is detected by the server during a handshake.
|
/// Fired whenever a certificate verification error is detected by the server during a handshake.
|
||||||
|
|
||||||
Poco::BasicEvent<VerificationErrorArgs> ClientVerificationError;
|
Poco::BasicEvent<VerificationErrorArgs> ClientVerificationError;
|
||||||
/// Thrown whenever a certificate error is detected by the client during a handshake.
|
/// Fired whenever a certificate verification error is detected by the client during a handshake.
|
||||||
|
|
||||||
Poco::BasicEvent<std::string> PrivateKeyPassPhrase;
|
Poco::BasicEvent<std::string> PrivateKeyPassphraseRequired;
|
||||||
/// Thrown when a encrypted certificate is loaded. Not setting the password
|
/// Fired when a encrypted certificate is loaded. Not setting the password
|
||||||
/// in the event parameter will result in a failure to load the certificate.
|
/// in the event parameter will result in a failure to load the certificate.
|
||||||
///
|
///
|
||||||
/// Per default the SSLManager checks the configuration.xml file (path openSSL.privateKeyPassphraseHandler.name)
|
/// Per default the SSLManager checks the configuration.xml file (path openSSL.privateKeyPassphraseHandler.name)
|
||||||
/// for which default delegate it should register. If nothing is configured,
|
/// for which default delegate it should register. If nothing is configured,
|
||||||
/// a KeyConsoleHandler is used.
|
/// a KeyConsoleHandler is used.
|
||||||
|
|
||||||
static SSLManager& instance();
|
static SSLManager& instance();
|
||||||
/// Returns the instance of the SSLManager singleton.
|
/// Returns the instance of the SSLManager singleton.
|
||||||
|
|
||||||
void initializeServer(PrivateKeyPassphraseHandlerPtr ptrPassPhraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext);
|
void initializeServer(PrivateKeyPassphraseHandlerPtr ptrPassPhraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext);
|
||||||
/// Initializes the server side of the SSLManager with a default passphrase handler, a default invalid certificate handler and a default context. If this method
|
/// Initializes the server side of the SSLManager with a default passphrase handler, a default invalid certificate handler and a default context. If this method
|
||||||
/// is never called the SSLmanager will try to initialize its members from an application configuration.
|
/// is never called the SSLmanager will try to initialize its members from an application configuration.
|
||||||
///
|
///
|
||||||
/// Note: ALWAYS create the handlers before you create the context!
|
/// PtrPassphraseHandler and ptrCertificateHandler can be 0. However, in this case, event delegates
|
||||||
///
|
/// must be registered with the ServerVerificationError and PrivateKeyPassphraseRequired events.
|
||||||
/// Valid initialization code would be:
|
///
|
||||||
/// SharedPtr<PrivateKeyPassphraseHandler> ptrConsole = new KeyConsoleHandler();
|
/// Note: Always create the handlers (or register the corresponding event delegates) before creating
|
||||||
/// SharedPtr<InvalidCertificateHandler> ptrCert = new ConsoleCertificateHandler();
|
/// the Context, as during creation of the Context the passphrase for the private key might be needed.
|
||||||
/// Context::Ptr ptrContext = new Context("any.pem", "rootcert.pem", Context::Relaxed, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
///
|
||||||
///
|
/// Valid initialization code would be:
|
||||||
/// This method can only be called if no defaultContext is set yet.
|
/// SharedPtr<PrivateKeyPassphraseHandler> pConsoleHandler = new KeyConsoleHandler;
|
||||||
|
/// SharedPtr<InvalidCertificateHandler> pInvalidCertHandler = new ConsoleCertificateHandler;
|
||||||
|
/// Context::Ptr pContext = new Context(Context::SERVER_USE, "any.pem", "any.pem", "rootcert.pem", Context::VERIFY_RELAXED, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
||||||
|
/// SSLManager::instance().initializeServer(pConsoleHandler, pInvalidCertHandler, pContext);
|
||||||
|
|
||||||
void initializeClient(PrivateKeyPassphraseHandlerPtr ptrPassPhraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext);
|
void initializeClient(PrivateKeyPassphraseHandlerPtr ptrPassphraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext);
|
||||||
/// Initializes the client side of the SSLManager with a default passphrase handler, a default invalid certificate handler and a default context. If this method
|
/// Initializes the client side of the SSLManager with a default passphrase handler, a default invalid certificate handler and a default context. If this method
|
||||||
/// is never called the SSLmanager will try to initialize its members from an application configuration.
|
/// is never called the SSLmanager will try to initialize its members from an application configuration.
|
||||||
///
|
///
|
||||||
/// Note: ALWAYS create the handlers before you create the context!
|
/// PtrPassphraseHandler and ptrCertificateHandler can be 0. However, in this case, event delegates
|
||||||
///
|
/// must be registered with the ClientVerificationError and PrivateKeyPassphraseRequired events.
|
||||||
/// Valid initialization code would be:
|
///
|
||||||
/// SharedPtr<PrivateKeyPassphraseHandler> ptrConsole = new KeyConsoleHandler();
|
/// Note: Always create the handlers (or register the corresponding event delegates) before creating
|
||||||
/// SharedPtr<InvalidCertificateHandler> ptrCert = new ConsoleCertificateHandler();
|
/// the Context, as during creation of the Context the passphrase for the private key might be needed.
|
||||||
/// Context::Ptr ptrContext = new Context("any.pem", "rootcert.pem", Context::Relaxed, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
///
|
||||||
///
|
/// Valid initialization code would be:
|
||||||
/// This method can only be called if no defaultContext is set yet.
|
/// SharedPtr<PrivateKeyPassphraseHandler> pConsoleHandler = new KeyConsoleHandler;
|
||||||
|
/// SharedPtr<InvalidCertificateHandler> pInvalidCertHandler = new ConsoleCertificateHandler;
|
||||||
|
/// Context::Ptr pContext = new Context(Context::CLIENT_USE, "", "", "rootcert.pem", Context::VERIFY_RELAXED, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
||||||
|
/// SSLManager::instance().initializeClient(pConsoleHandler, pInvalidCertHandler, pContext);
|
||||||
|
|
||||||
Context::Ptr defaultServerContext();
|
Context::Ptr defaultServerContext();
|
||||||
/// Returns the default context used by the server. The first call to this method initializes the defaultContext
|
/// Returns the default Context used by the server.
|
||||||
/// from an application configuration.
|
///
|
||||||
|
/// Unless initializeServer() has been called, the first call to this method initializes the default Context
|
||||||
|
/// from the application configuration.
|
||||||
|
|
||||||
Context::Ptr defaultClientContext();
|
Context::Ptr defaultClientContext();
|
||||||
/// Returns the default context used by the client. The first call to this method initializes the defaultContext
|
/// Returns the default Context used by the client.
|
||||||
/// from an application configuration.
|
///
|
||||||
|
/// Unless initializeClient() has been called, the first call to this method initializes the default Context
|
||||||
|
/// from the application configuration.
|
||||||
|
|
||||||
PrivateKeyPassphraseHandlerPtr serverPassPhraseHandler();
|
PrivateKeyPassphraseHandlerPtr serverPassphraseHandler();
|
||||||
/// Returns the configured passphrase handler of the server. If none is set, the method will create a default one
|
/// Returns the configured passphrase handler of the server. If none is set, the method will create a default one
|
||||||
/// from an application configuration
|
/// from an application configuration.
|
||||||
|
|
||||||
InvalidCertificateHandlerPtr serverCertificateHandler();
|
InvalidCertificateHandlerPtr serverCertificateHandler();
|
||||||
/// Returns an initialized certificate handler (used by the server to verify client cert) which determines how invalid certificates are treated.
|
/// Returns an initialized certificate handler (used by the server to verify client cert) which determines how invalid certificates are treated.
|
||||||
/// If none is set, it will try to auto-initialize one from an application configuration.
|
/// If none is set, it will try to auto-initialize one from an application configuration.
|
||||||
|
|
||||||
PrivateKeyPassphraseHandlerPtr clientPassPhraseHandler();
|
PrivateKeyPassphraseHandlerPtr clientPassphraseHandler();
|
||||||
/// Returns the configured passphrase handler of the client. If none is set, the method will create a default one
|
/// Returns the configured passphrase handler of the client. If none is set, the method will create a default one
|
||||||
/// from an application configuration
|
/// from an application configuration.
|
||||||
|
|
||||||
InvalidCertificateHandlerPtr clientCertificateHandler();
|
InvalidCertificateHandlerPtr clientCertificateHandler();
|
||||||
/// Returns an initialized certificate handler (used by the client to verify server cert) which determines how invalid certificates are treated.
|
/// Returns an initialized certificate handler (used by the client to verify server cert) which determines how invalid certificates are treated.
|
||||||
/// If none is set, it will try to auto-initialize one from an application configuration.
|
/// If none is set, it will try to auto-initialize one from an application configuration.
|
||||||
|
|
||||||
PrivateKeyFactoryMgr& privateKeyFactoryMgr();
|
PrivateKeyFactoryMgr& privateKeyFactoryMgr();
|
||||||
@@ -172,11 +240,23 @@ public:
|
|||||||
/// factories for the different registered passphrase handlers for private keys.
|
/// factories for the different registered passphrase handlers for private keys.
|
||||||
|
|
||||||
CertificateHandlerFactoryMgr& certificateHandlerFactoryMgr();
|
CertificateHandlerFactoryMgr& certificateHandlerFactoryMgr();
|
||||||
/// Returns the CertificateHandlerFactoryMgr which stores the
|
/// Returns the CertificateHandlerFactoryMgr which stores the
|
||||||
/// factories for the different registered certificate handlers.
|
/// factories for the different registered certificate handlers.
|
||||||
|
|
||||||
static const std::string CFG_SERVER_PREFIX;
|
static bool isFIPSEnabled();
|
||||||
static const std::string CFG_CLIENT_PREFIX;
|
// Returns true if FIPS mode is enabled, false otherwise.
|
||||||
|
|
||||||
|
void shutdown();
|
||||||
|
/// Shuts down the SSLManager and releases the default Context
|
||||||
|
/// objects. After a call to shutdown(), the SSLManager can no
|
||||||
|
/// longer be used.
|
||||||
|
///
|
||||||
|
/// Normally, it's not necessary to call this method directly, as this
|
||||||
|
/// will be called either by uninitializeSSL(), or when
|
||||||
|
/// the SSLManager instance is destroyed.
|
||||||
|
|
||||||
|
static const std::string CFG_SERVER_PREFIX;
|
||||||
|
static const std::string CFG_CLIENT_PREFIX;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static int verifyClientCallback(int ok, X509_STORE_CTX* pStore);
|
static int verifyClientCallback(int ok, X509_STORE_CTX* pStore);
|
||||||
@@ -186,17 +266,22 @@ protected:
|
|||||||
|
|
||||||
static int verifyServerCallback(int ok, X509_STORE_CTX* pStore);
|
static int verifyServerCallback(int ok, X509_STORE_CTX* pStore);
|
||||||
/// The return value of this method defines how errors in
|
/// The return value of this method defines how errors in
|
||||||
/// verification are handled. Return 0 to terminate the handshake,
|
/// verification are handled. Return 0 to terminate the handshake,
|
||||||
/// or 1 to continue despite the error.
|
/// or 1 to continue despite the error.
|
||||||
|
|
||||||
static int privateKeyPasswdCallback(char* pBuf, int size, int flag, void* userData);
|
static int privateKeyPassphraseCallback(char* pBuf, int size, int flag, void* userData);
|
||||||
/// Method is invoked by OpenSSL to retrieve a passwd for an encrypted certificate.
|
/// Method is invoked by OpenSSL to retrieve a passwd for an encrypted certificate.
|
||||||
/// The request is delegated to the PrivatekeyPassword event. This method returns the
|
/// The request is delegated to the PrivatekeyPassword event. This method returns the
|
||||||
/// length of the password.
|
/// length of the password.
|
||||||
|
|
||||||
|
static Poco::Util::AbstractConfiguration& appConfig();
|
||||||
|
/// Returns the application configuration.
|
||||||
|
///
|
||||||
|
/// Throws a
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SSLManager();
|
SSLManager();
|
||||||
/// Creates the SSLManager.
|
/// Creates the SSLManager.
|
||||||
|
|
||||||
~SSLManager();
|
~SSLManager();
|
||||||
/// Destroys the SSLManager.
|
/// Destroys the SSLManager.
|
||||||
@@ -204,13 +289,13 @@ private:
|
|||||||
void initDefaultContext(bool server);
|
void initDefaultContext(bool server);
|
||||||
/// Inits the default context, the first time it is accessed.
|
/// Inits the default context, the first time it is accessed.
|
||||||
|
|
||||||
void initEvents(bool server);
|
void initEvents(bool server);
|
||||||
/// Registers delegates at the events according to the configuration.
|
/// Registers delegates at the events according to the configuration.
|
||||||
|
|
||||||
void initPassPhraseHandler(bool server);
|
void initPassphraseHandler(bool server);
|
||||||
/// Inits the passphrase handler.
|
/// Inits the passphrase handler.
|
||||||
|
|
||||||
void initCertificateHandler(bool server);
|
void initCertificateHandler(bool server);
|
||||||
/// Inits the certificate handler.
|
/// Inits the certificate handler.
|
||||||
|
|
||||||
static int verifyCallback(bool server, int ok, X509_STORE_CTX* pStore);
|
static int verifyCallback(bool server, int ok, X509_STORE_CTX* pStore);
|
||||||
@@ -218,33 +303,45 @@ private:
|
|||||||
/// verification are handled. Return 0 to terminate the handshake,
|
/// verification are handled. Return 0 to terminate the handshake,
|
||||||
/// or 1 to continue despite the error.
|
/// or 1 to continue despite the error.
|
||||||
|
|
||||||
PrivateKeyFactoryMgr _factoryMgr;
|
PrivateKeyFactoryMgr _factoryMgr;
|
||||||
CertificateHandlerFactoryMgr _certHandlerFactoryMgr;
|
CertificateHandlerFactoryMgr _certHandlerFactoryMgr;
|
||||||
Context::Ptr _ptrDefaultServerContext;
|
Context::Ptr _ptrDefaultServerContext;
|
||||||
PrivateKeyPassphraseHandlerPtr _ptrServerPassPhraseHandler;
|
PrivateKeyPassphraseHandlerPtr _ptrServerPassphraseHandler;
|
||||||
InvalidCertificateHandlerPtr _ptrServerCertificateHandler;
|
InvalidCertificateHandlerPtr _ptrServerCertificateHandler;
|
||||||
Context::Ptr _ptrDefaultClientContext;
|
Context::Ptr _ptrDefaultClientContext;
|
||||||
PrivateKeyPassphraseHandlerPtr _ptrClientPassPhraseHandler;
|
PrivateKeyPassphraseHandlerPtr _ptrClientPassphraseHandler;
|
||||||
InvalidCertificateHandlerPtr _ptrClientCertificateHandler;
|
InvalidCertificateHandlerPtr _ptrClientCertificateHandler;
|
||||||
|
Poco::FastMutex _mutex;
|
||||||
|
|
||||||
static const std::string CFG_PRIV_KEY_FILE;
|
static const std::string CFG_PRIV_KEY_FILE;
|
||||||
static const std::string CFG_CERTIFICATE_FILE;
|
static const std::string CFG_CERTIFICATE_FILE;
|
||||||
static const std::string CFG_CA_LOCATION;
|
static const std::string CFG_CA_LOCATION;
|
||||||
static const std::string CFG_VER_MODE;
|
static const std::string CFG_VER_MODE;
|
||||||
static const Context::VerificationMode VAL_VER_MODE;
|
static const Context::VerificationMode VAL_VER_MODE;
|
||||||
static const std::string CFG_VER_DEPTH;
|
static const std::string CFG_VER_DEPTH;
|
||||||
static const int VAL_VER_DEPTH;
|
static const int VAL_VER_DEPTH;
|
||||||
static const std::string CFG_ENABLE_DEFAULT_CA;
|
static const std::string CFG_ENABLE_DEFAULT_CA;
|
||||||
static const bool VAL_ENABLE_DEFAULT_CA;
|
static const bool VAL_ENABLE_DEFAULT_CA;
|
||||||
static const std::string CFG_CYPHER_LIST;
|
static const std::string CFG_CIPHER_LIST;
|
||||||
static const std::string VAL_CYPHER_LIST;
|
static const std::string CFG_CYPHER_LIST; // for backwards compatibility
|
||||||
static const std::string CFG_DELEGATE_HANDLER;
|
static const std::string VAL_CIPHER_LIST;
|
||||||
static const std::string VAL_DELEGATE_HANDLER;
|
static const std::string CFG_DELEGATE_HANDLER;
|
||||||
static const std::string CFG_CERTIFICATE_HANDLER;
|
static const std::string VAL_DELEGATE_HANDLER;
|
||||||
static const std::string VAL_CERTIFICATE_HANDLER;
|
static const std::string CFG_CERTIFICATE_HANDLER;
|
||||||
|
static const std::string VAL_CERTIFICATE_HANDLER;
|
||||||
|
static const std::string CFG_CACHE_SESSIONS;
|
||||||
|
static const std::string CFG_SESSION_ID_CONTEXT;
|
||||||
|
static const std::string CFG_SESSION_CACHE_SIZE;
|
||||||
|
static const std::string CFG_SESSION_TIMEOUT;
|
||||||
|
static const std::string CFG_EXTENDED_VERIFICATION;
|
||||||
|
|
||||||
friend class Poco::SingletonHolder<SSLManager>;
|
#ifdef OPENSSL_FIPS
|
||||||
friend class Context;
|
static const std::string CFG_FIPS_MODE;
|
||||||
|
static const bool VAL_FIPS_MODE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
friend class Poco::SingletonHolder<SSLManager>;
|
||||||
|
friend class Context;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -263,9 +360,19 @@ inline CertificateHandlerFactoryMgr& SSLManager::certificateHandlerFactoryMgr()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool SSLManager::isFIPSEnabled()
|
||||||
|
{
|
||||||
|
#ifdef OPENSSL_FIPS
|
||||||
|
return FIPS_mode() ? true : false;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline int SSLManager::verifyServerCallback(int ok, X509_STORE_CTX* pStore)
|
inline int SSLManager::verifyServerCallback(int ok, X509_STORE_CTX* pStore)
|
||||||
{
|
{
|
||||||
return SSLManager::verifyCallback(true, ok, pStore);
|
return SSLManager::verifyCallback(true, ok, pStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
115
NetSSL_OpenSSL/include/Poco/Net/SecureSMTPClientSession.h
Normal file
115
NetSSL_OpenSSL/include/Poco/Net/SecureSMTPClientSession.h
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
//
|
||||||
|
// SecureSMTPClientSession.h
|
||||||
|
//
|
||||||
|
// $Id: //poco/1.4/NetSSL_OpenSSL/include/Poco/Net/SecureSMTPClientSession.h#1 $
|
||||||
|
//
|
||||||
|
// Library: NetSSL_OpenSSL
|
||||||
|
// Package: Mail
|
||||||
|
// Module: SecureSMTPClientSession
|
||||||
|
//
|
||||||
|
// Definition of the SecureSMTPClientSession class.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2010, Applied Informatics Software Engineering GmbH.
|
||||||
|
// and Contributors.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
|
// obtaining a copy of the software and accompanying documentation covered by
|
||||||
|
// this license (the "Software") to use, reproduce, display, distribute,
|
||||||
|
// execute, and transmit the Software, and to prepare derivative works of the
|
||||||
|
// Software, and to permit third-parties to whom the Software is furnished to
|
||||||
|
// do so, all subject to the following:
|
||||||
|
//
|
||||||
|
// The copyright notices in the Software and this entire statement, including
|
||||||
|
// the above license grant, this restriction and the following disclaimer,
|
||||||
|
// must be included in all copies of the Software, in whole or in part, and
|
||||||
|
// all derivative works of the Software, unless such copies or derivative
|
||||||
|
// works are solely in the form of machine-executable object code generated by
|
||||||
|
// a source language processor.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||||
|
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||||
|
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||||
|
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef Net_SecureSMTPClientSession_INCLUDED
|
||||||
|
#define Net_SecureSMTPClientSession_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
|
#include "Poco/Net/NetSSL.h"
|
||||||
|
#include "Poco/Net/SMTPClientSession.h"
|
||||||
|
#include "Poco/Net/Context.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Poco {
|
||||||
|
namespace Net {
|
||||||
|
|
||||||
|
|
||||||
|
class NetSSL_API SecureSMTPClientSession: public SMTPClientSession
|
||||||
|
/// This class implements an Simple Mail
|
||||||
|
/// Transfer Procotol (SMTP, RFC 2821)
|
||||||
|
/// client for sending e-mail messages that
|
||||||
|
/// supports the STARTTLS command for secure
|
||||||
|
/// connections.
|
||||||
|
///
|
||||||
|
/// Usage is as follows:
|
||||||
|
/// 1. Create a SecureSMTPClientSession object.
|
||||||
|
/// 2. Call login() or login(hostname).
|
||||||
|
/// 3. Call startTLS() to switch to a secure connection.
|
||||||
|
/// Check the return value to see if a secure connection
|
||||||
|
/// has actually been established (not all servers may
|
||||||
|
/// support STARTTLS).
|
||||||
|
/// 4. Call any of the login() methods to securely authenticate
|
||||||
|
/// with a username and password.
|
||||||
|
/// 5. Send the message(s).
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit SecureSMTPClientSession(const StreamSocket& socket);
|
||||||
|
/// Creates the SecureSMTPClientSession using
|
||||||
|
/// the given socket, which must be connected
|
||||||
|
/// to a SMTP server.
|
||||||
|
|
||||||
|
SecureSMTPClientSession(const std::string& host, Poco::UInt16 port = SMTP_PORT);
|
||||||
|
/// Creates the SecureSMTPClientSession using a socket connected
|
||||||
|
/// to the given host and port.
|
||||||
|
|
||||||
|
virtual ~SecureSMTPClientSession();
|
||||||
|
/// Destroys the SMTPClientSession.
|
||||||
|
|
||||||
|
bool startTLS();
|
||||||
|
/// Sends a STARTTLS command and, if successful,
|
||||||
|
/// creates a secure SSL/TLS connection over the
|
||||||
|
/// existing socket connection.
|
||||||
|
///
|
||||||
|
/// Must be called after login() or login(hostname).
|
||||||
|
/// If successful, login() can be called again
|
||||||
|
/// to authenticate the user.
|
||||||
|
///
|
||||||
|
/// Returns true if the STARTTLS command was successful,
|
||||||
|
/// false otherwise.
|
||||||
|
|
||||||
|
bool startTLS(Context::Ptr pContext);
|
||||||
|
/// Sends a STARTTLS command and, if successful,
|
||||||
|
/// creates a secure SSL/TLS connection over the
|
||||||
|
/// existing socket connection.
|
||||||
|
///
|
||||||
|
/// Uses the given Context object for creating
|
||||||
|
/// the SSL/TLS connection.
|
||||||
|
///
|
||||||
|
/// Must be called after login() or login(hostname).
|
||||||
|
/// If successful, login() can be called again
|
||||||
|
/// to authenticate the user.
|
||||||
|
///
|
||||||
|
/// Returns true if the STARTTLS command was successful,
|
||||||
|
/// false otherwise.
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} } // namespace Poco::Net
|
||||||
|
|
||||||
|
|
||||||
|
#endif // Net_SecureSMTPClientSession_INCLUDED
|
@@ -123,22 +123,32 @@ public:
|
|||||||
/// request completes.
|
/// request completes.
|
||||||
///
|
///
|
||||||
/// Returns a new SSL socket for the connection
|
/// Returns a new SSL socket for the connection
|
||||||
/// with the client.
|
/// with the client.
|
||||||
///
|
///
|
||||||
/// The client socket's address is returned in clientAddr.
|
/// The client socket's address is returned in clientAddr.
|
||||||
|
///
|
||||||
|
/// No SSL handshake is performed on the new connection.
|
||||||
|
/// The SSL handshake will be performed the first time
|
||||||
|
/// sendBytes(), receiveBytes() or completeHandshake()
|
||||||
|
/// is called on the returned SecureStreamSocket.
|
||||||
|
|
||||||
StreamSocket acceptConnection();
|
StreamSocket acceptConnection();
|
||||||
/// Get the next completed connection from the
|
/// Get the next completed connection from the
|
||||||
/// socket's completed connection queue.
|
/// socket's completed connection queue.
|
||||||
///
|
///
|
||||||
/// If the queue is empty, waits until a connection
|
/// If the queue is empty, waits until a connection
|
||||||
/// request completes.
|
/// request completes.
|
||||||
///
|
///
|
||||||
/// Returns a new SSL socket for the connection
|
/// Returns a new SSL socket for the connection
|
||||||
/// with the client.
|
/// with the client.
|
||||||
|
///
|
||||||
|
/// No SSL handshake is performed on the new connection.
|
||||||
|
/// The SSL handshake will be performed the first time
|
||||||
|
/// sendBytes(), receiveBytes() or completeHandshake()
|
||||||
|
/// is called on the returned SecureStreamSocket.
|
||||||
|
|
||||||
Context::Ptr context() const;
|
Context::Ptr context() const;
|
||||||
/// Returns the SSL context used by this socket.
|
/// Returns the SSL context used by this socket.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -130,11 +130,15 @@ public:
|
|||||||
|
|
||||||
void sendUrgent(unsigned char data);
|
void sendUrgent(unsigned char data);
|
||||||
/// Not supported by this kind of socket.
|
/// Not supported by this kind of socket.
|
||||||
///
|
///
|
||||||
/// Throws a Poco::InvalidAccessException.
|
/// Throws a Poco::InvalidAccessException.
|
||||||
|
|
||||||
Context::Ptr context() const;
|
bool secure() const;
|
||||||
/// Returns the SSL context used by this socket.
|
/// Returns true iff the socket's connection is secure
|
||||||
|
/// (using SSL or TLS).
|
||||||
|
|
||||||
|
Context::Ptr context() const;
|
||||||
|
/// Returns the SSL context used by this socket.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~SecureServerSocketImpl();
|
~SecureServerSocketImpl();
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
// Definition of the SecureSocketImpl class.
|
// Definition of the SecureSocketImpl class.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@@ -44,6 +44,7 @@
|
|||||||
#include "Poco/Net/SocketImpl.h"
|
#include "Poco/Net/SocketImpl.h"
|
||||||
#include "Poco/Net/Context.h"
|
#include "Poco/Net/Context.h"
|
||||||
#include "Poco/Net/X509Certificate.h"
|
#include "Poco/Net/X509Certificate.h"
|
||||||
|
#include "Poco/Net/Session.h"
|
||||||
#include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
@@ -75,32 +76,33 @@ public:
|
|||||||
///
|
///
|
||||||
/// Returns a new SSL socket for the connection
|
/// Returns a new SSL socket for the connection
|
||||||
/// with the client.
|
/// with the client.
|
||||||
///
|
///
|
||||||
/// The client socket's address is returned in clientAddr.
|
/// The client socket's address is returned in clientAddr.
|
||||||
|
|
||||||
void acceptSSL();
|
void connect(const SocketAddress& address, bool performHandshake);
|
||||||
/// Performs a server-side SSL handshake and certificate verification.
|
/// Initializes the socket and establishes a secure connection to
|
||||||
|
/// the TCP server at the given address.
|
||||||
|
///
|
||||||
|
/// If performHandshake is true, the SSL handshake is performed immediately
|
||||||
|
/// after establishing the connection. Otherwise, the handshake is performed
|
||||||
|
/// the first time sendBytes(), receiveBytes() or completeHandshake() is called.
|
||||||
|
|
||||||
void connect(const SocketAddress& address, const std::string& hostName);
|
void connect(const SocketAddress& address, const Poco::Timespan& timeout, bool performHandshake);
|
||||||
/// Initializes the socket and establishes a secure connection to
|
/// Initializes the socket, sets the socket timeout and
|
||||||
/// the TCP server at the given address.
|
/// establishes a secure connection to the TCP server at the given address.
|
||||||
|
///
|
||||||
|
/// If performHandshake is true, the SSL handshake is performed immediately
|
||||||
|
/// after establishing the connection. Otherwise, the handshake is performed
|
||||||
|
/// the first time sendBytes(), receiveBytes() or completeHandshake() is called.
|
||||||
|
|
||||||
void connect(const SocketAddress& address, const std::string& hostName, const Poco::Timespan& timeout);
|
void connectNB(const SocketAddress& address);
|
||||||
/// Initializes the socket, sets the socket timeout and
|
/// Initializes the socket and establishes a secure connection to
|
||||||
/// establishes a secure connection to the TCP server at the given address.
|
/// the TCP server at the given address. Prior to opening the
|
||||||
|
/// connection the socket is set to nonblocking mode.
|
||||||
|
|
||||||
void connectNB(const SocketAddress& address, const std::string& hostName);
|
void bind(const SocketAddress& address, bool reuseAddress = false);
|
||||||
/// Initializes the socket and establishes a secure connection to
|
/// Bind a local address to the socket.
|
||||||
/// the TCP server at the given address. Prior to opening the
|
///
|
||||||
/// connection the socket is set to nonblocking mode.
|
|
||||||
|
|
||||||
void connectSSL(const std::string& hostName);
|
|
||||||
/// Performs a client-side SSL handshake and establishes a secure
|
|
||||||
/// connection over an already existing TCP connection.
|
|
||||||
|
|
||||||
void bind(const SocketAddress& address, bool reuseAddress = false);
|
|
||||||
/// Bind a local address to the socket.
|
|
||||||
///
|
|
||||||
/// This is usually only done when establishing a server
|
/// This is usually only done when establishing a server
|
||||||
/// socket. SSL clients should not bind a socket to a
|
/// socket. SSL clients should not bind a socket to a
|
||||||
/// specific address.
|
/// specific address.
|
||||||
@@ -123,12 +125,17 @@ public:
|
|||||||
/// an orderly SSL shutdown, then actually
|
/// an orderly SSL shutdown, then actually
|
||||||
/// shutting down the TCP connection.
|
/// shutting down the TCP connection.
|
||||||
|
|
||||||
void close();
|
void close();
|
||||||
/// Close the socket.
|
/// Close the socket.
|
||||||
|
|
||||||
int sendBytes(const void* buffer, int length, int flags = 0);
|
void abort();
|
||||||
/// Sends the contents of the given buffer through
|
/// Aborts the connection by closing the
|
||||||
/// the socket. Any specified flags are ignored.
|
/// underlying TCP connection. No orderly SSL shutdown
|
||||||
|
/// is performed.
|
||||||
|
|
||||||
|
int sendBytes(const void* buffer, int length, int flags = 0);
|
||||||
|
/// Sends the contents of the given buffer through
|
||||||
|
/// the socket. Any specified flags are ignored.
|
||||||
///
|
///
|
||||||
/// Returns the number of bytes sent, which may be
|
/// Returns the number of bytes sent, which may be
|
||||||
/// less than the number of bytes specified.
|
/// less than the number of bytes specified.
|
||||||
@@ -136,36 +143,104 @@ public:
|
|||||||
int receiveBytes(void* buffer, int length, int flags = 0);
|
int receiveBytes(void* buffer, int length, int flags = 0);
|
||||||
/// Receives data from the socket and stores it
|
/// Receives data from the socket and stores it
|
||||||
/// in buffer. Up to length bytes are received.
|
/// in buffer. Up to length bytes are received.
|
||||||
///
|
///
|
||||||
/// Returns the number of bytes received.
|
/// Returns the number of bytes received.
|
||||||
|
|
||||||
poco_socket_t sockfd();
|
int available() const;
|
||||||
/// Returns the underlying socket descriptor.
|
/// Returns the number of bytes available from the
|
||||||
|
/// SSL buffer for immediate reading.
|
||||||
|
|
||||||
|
int completeHandshake();
|
||||||
|
/// Completes the SSL handshake.
|
||||||
|
///
|
||||||
|
/// If the SSL connection was the result of an accept(),
|
||||||
|
/// the server-side handshake is completed, otherwise
|
||||||
|
/// a client-side handshake is performed.
|
||||||
|
|
||||||
|
poco_socket_t sockfd();
|
||||||
|
/// Returns the underlying socket descriptor.
|
||||||
|
|
||||||
X509* peerCertificate() const;
|
X509* peerCertificate() const;
|
||||||
/// Returns the peer's certificate.
|
/// Returns the peer's certificate.
|
||||||
|
|
||||||
Context::Ptr context() const;
|
Context::Ptr context() const;
|
||||||
/// Returns the SSL context used for this socket.
|
/// Returns the SSL context used for this socket.
|
||||||
|
|
||||||
|
void verifyPeerCertificate();
|
||||||
|
/// Performs post-connect (or post-accept) peer certificate validation,
|
||||||
|
/// using the peer host name set with setPeerHostName(), or the peer's
|
||||||
|
/// IP address string if no peer host name has been set.
|
||||||
|
|
||||||
|
void verifyPeerCertificate(const std::string& hostName);
|
||||||
|
/// Performs post-connect (or post-accept) peer certificate validation
|
||||||
|
/// using the given peer host name.
|
||||||
|
|
||||||
|
void setPeerHostName(const std::string& hostName);
|
||||||
|
/// Sets the peer host name for certificate validation purposes.
|
||||||
|
|
||||||
|
const std::string& getPeerHostName() const;
|
||||||
|
/// Returns the peer host name.
|
||||||
|
|
||||||
|
Session::Ptr currentSession();
|
||||||
|
/// Returns the SSL session of the current connection,
|
||||||
|
/// for reuse in a future connection (if session caching
|
||||||
|
/// is enabled).
|
||||||
|
///
|
||||||
|
/// If no connection is established, returns null.
|
||||||
|
|
||||||
|
void useSession(Session::Ptr pSession);
|
||||||
|
/// Sets the SSL session to use for the next
|
||||||
|
/// connection. Setting a previously saved Session
|
||||||
|
/// object is necessary to enable session caching.
|
||||||
|
///
|
||||||
|
/// To remove the currently set session, a null pointer
|
||||||
|
/// can be given.
|
||||||
|
///
|
||||||
|
/// Must be called before connect() to be effective.
|
||||||
|
|
||||||
|
bool sessionWasReused();
|
||||||
|
/// Returns true iff a reused session was negotiated during
|
||||||
|
/// the handshake.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
long verifyCertificate(const std::string& hostName);
|
void acceptSSL();
|
||||||
/// PostConnectionCheck to verify that a peer really presented a valid certificate.
|
/// Performs a server-side SSL handshake and certificate verification.
|
||||||
|
|
||||||
static bool isLocalHost(const std::string& hostName);
|
void connectSSL(bool performHandshake);
|
||||||
/// Returns true iff the given host name is the local host
|
/// Performs a client-side SSL handshake and establishes a secure
|
||||||
|
/// connection over an already existing TCP connection.
|
||||||
|
|
||||||
|
long verifyPeerCertificateImpl(const std::string& hostName);
|
||||||
|
/// Performs post-connect (or post-accept) peer certificate validation.
|
||||||
|
|
||||||
|
static bool isLocalHost(const std::string& hostName);
|
||||||
|
/// Returns true iff the given host name is the local host
|
||||||
/// (either "localhost" or "127.0.0.1").
|
/// (either "localhost" or "127.0.0.1").
|
||||||
|
|
||||||
int handleError(int rc);
|
int handleError(int rc);
|
||||||
/// Handles an SSL error by throwing an appropriate exception.
|
/// Handles an SSL error by throwing an appropriate exception.
|
||||||
|
|
||||||
|
void reset();
|
||||||
|
/// Prepares the socket for re-use.
|
||||||
|
///
|
||||||
|
/// After closing and resetting a socket, the socket can
|
||||||
|
/// be used for a new connection.
|
||||||
|
///
|
||||||
|
/// Note that simply closing a socket is not sufficient
|
||||||
|
/// to be able to re-use it again.
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SecureSocketImpl(const SecureSocketImpl&);
|
SecureSocketImpl(const SecureSocketImpl&);
|
||||||
SecureSocketImpl& operator = (const SecureSocketImpl&);
|
SecureSocketImpl& operator = (const SecureSocketImpl&);
|
||||||
|
|
||||||
SSL* _pSSL;
|
SSL* _pSSL;
|
||||||
Poco::AutoPtr<SocketImpl> _pSocket;
|
Poco::AutoPtr<SocketImpl> _pSocket;
|
||||||
Context::Ptr _pContext;
|
Context::Ptr _pContext;
|
||||||
|
bool _needHandshake;
|
||||||
|
std::string _peerHostName;
|
||||||
|
Session::Ptr _pSession;
|
||||||
|
|
||||||
|
friend class SecureStreamSocketImpl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -184,6 +259,12 @@ inline Context::Ptr SecureSocketImpl::context() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const std::string& SecureSocketImpl::getPeerHostName() const
|
||||||
|
{
|
||||||
|
return _peerHostName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
// Definition of the SecureStreamSocket class.
|
// Definition of the SecureStreamSocket class.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@@ -43,6 +43,7 @@
|
|||||||
#include "Poco/Net/NetSSL.h"
|
#include "Poco/Net/NetSSL.h"
|
||||||
#include "Poco/Net/StreamSocket.h"
|
#include "Poco/Net/StreamSocket.h"
|
||||||
#include "Poco/Net/Context.h"
|
#include "Poco/Net/Context.h"
|
||||||
|
#include "Poco/Net/Session.h"
|
||||||
#include "Poco/Net/X509Certificate.h"
|
#include "Poco/Net/X509Certificate.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -64,13 +65,15 @@ class NetSSL_API SecureStreamSocket: public StreamSocket
|
|||||||
/// ERR_SSL_WANT_READ is returned, receiveBytes() must be called
|
/// ERR_SSL_WANT_READ is returned, receiveBytes() must be called
|
||||||
/// as soon as data is available for reading (indicated by select()).
|
/// as soon as data is available for reading (indicated by select()).
|
||||||
///
|
///
|
||||||
/// The SSL handshake is delayed until the first sendBytes() or
|
/// The SSL handshake is delayed until the first sendBytes() or
|
||||||
/// receiveBytes() operation is performed on the socket. No automatic
|
/// receiveBytes() operation is performed on the socket. No automatic
|
||||||
/// post connection check (checking the peer certificate for a valid
|
/// post connection check (checking the peer certificate for a valid
|
||||||
/// hostname) is performed when using nonblocking I/O.
|
/// hostname) is performed when using nonblocking I/O. To manually
|
||||||
|
/// perform peer certificate validation, call verifyPeerCertificate()
|
||||||
|
/// after the SSL handshake has been completed.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ERR_SSL_WANT_READ = -1,
|
ERR_SSL_WANT_READ = -1,
|
||||||
ERR_SSL_WANT_WRITE = -2
|
ERR_SSL_WANT_WRITE = -2
|
||||||
@@ -87,22 +90,42 @@ public:
|
|||||||
/// Creates an unconnected secure stream socket
|
/// Creates an unconnected secure stream socket
|
||||||
/// using the given SSL context.
|
/// using the given SSL context.
|
||||||
///
|
///
|
||||||
/// Before sending or receiving data, the socket
|
/// Before sending or receiving data, the socket
|
||||||
/// must be connected with a call to connect().
|
/// must be connected with a call to connect().
|
||||||
|
|
||||||
explicit SecureStreamSocket(const SocketAddress& address);
|
SecureStreamSocket(Context::Ptr pContext, Session::Ptr pSession);
|
||||||
/// Creates a secure stream socket using the default
|
/// Creates an unconnected secure stream socket
|
||||||
/// client SSL context and connects it to
|
/// using the given SSL context.
|
||||||
|
///
|
||||||
|
/// Before sending or receiving data, the socket
|
||||||
|
/// must be connected with a call to connect().
|
||||||
|
///
|
||||||
|
/// The given Session is reused, if possible (client session
|
||||||
|
/// caching is enabled for the given Context, and the server
|
||||||
|
/// agrees to reuse the session).
|
||||||
|
|
||||||
|
explicit SecureStreamSocket(const SocketAddress& address);
|
||||||
|
/// Creates a secure stream socket using the default
|
||||||
|
/// client SSL context and connects it to
|
||||||
/// the socket specified by address.
|
/// the socket specified by address.
|
||||||
|
|
||||||
SecureStreamSocket(const SocketAddress& address, Context::Ptr pContext);
|
SecureStreamSocket(const SocketAddress& address, Context::Ptr pContext);
|
||||||
/// Creates a secure stream socket using the given
|
/// Creates a secure stream socket using the given
|
||||||
/// client SSL context and connects it to
|
/// client SSL context and connects it to
|
||||||
/// the socket specified by address.
|
/// the socket specified by address.
|
||||||
|
|
||||||
SecureStreamSocket(const SocketAddress& address, const std::string& hostName);
|
SecureStreamSocket(const SocketAddress& address, Context::Ptr pContext, Session::Ptr pSession);
|
||||||
/// Creates a secure stream socket using the default
|
/// Creates a secure stream socket using the given
|
||||||
/// client SSL context and connects it to
|
/// client SSL context and connects it to
|
||||||
|
/// the socket specified by address.
|
||||||
|
///
|
||||||
|
/// The given Session is reused, if possible (client session
|
||||||
|
/// caching is enabled for the given Context, and the server
|
||||||
|
/// agrees to reuse the session).
|
||||||
|
|
||||||
|
SecureStreamSocket(const SocketAddress& address, const std::string& hostName);
|
||||||
|
/// Creates a secure stream socket using the default
|
||||||
|
/// client SSL context and connects it to
|
||||||
/// the socket specified by address.
|
/// the socket specified by address.
|
||||||
///
|
///
|
||||||
/// The given host name is used for certificate verification.
|
/// The given host name is used for certificate verification.
|
||||||
@@ -111,12 +134,23 @@ public:
|
|||||||
/// Creates a secure stream socket using the given
|
/// Creates a secure stream socket using the given
|
||||||
/// client SSL context and connects it to
|
/// client SSL context and connects it to
|
||||||
/// the socket specified by address.
|
/// the socket specified by address.
|
||||||
///
|
///
|
||||||
/// The given host name is used for certificate verification.
|
/// The given host name is used for certificate verification.
|
||||||
|
|
||||||
SecureStreamSocket(const Socket& socket);
|
SecureStreamSocket(const SocketAddress& address, const std::string& hostName, Context::Ptr pContext, Session::Ptr pSession);
|
||||||
/// Creates the SecureStreamSocket with the SocketImpl
|
/// Creates a secure stream socket using the given
|
||||||
/// from another socket. The SocketImpl must be
|
/// client SSL context and connects it to
|
||||||
|
/// the socket specified by address.
|
||||||
|
///
|
||||||
|
/// The given host name is used for certificate verification.
|
||||||
|
///
|
||||||
|
/// The given Session is reused, if possible (client session
|
||||||
|
/// caching is enabled for the given Context, and the server
|
||||||
|
/// agrees to reuse the session).
|
||||||
|
|
||||||
|
SecureStreamSocket(const Socket& socket);
|
||||||
|
/// Creates the SecureStreamSocket with the SocketImpl
|
||||||
|
/// from another socket. The SocketImpl must be
|
||||||
/// a SecureStreamSocketImpl, otherwise an InvalidArgumentException
|
/// a SecureStreamSocketImpl, otherwise an InvalidArgumentException
|
||||||
/// will be thrown.
|
/// will be thrown.
|
||||||
|
|
||||||
@@ -127,14 +161,21 @@ public:
|
|||||||
/// Assignment operator.
|
/// Assignment operator.
|
||||||
///
|
///
|
||||||
/// Releases the socket's SocketImpl and
|
/// Releases the socket's SocketImpl and
|
||||||
/// attaches the SocketImpl from the other socket and
|
/// attaches the SocketImpl from the other socket and
|
||||||
/// increments the reference count of the SocketImpl.
|
/// increments the reference count of the SocketImpl.
|
||||||
|
|
||||||
X509Certificate peerCertificate() const;
|
bool havePeerCertificate() const;
|
||||||
/// Returns the peer's X509 certificate.
|
/// Returns true iff the peer has presented a
|
||||||
|
/// certificate.
|
||||||
|
|
||||||
void setPeerHostName(const std::string& hostName);
|
X509Certificate peerCertificate() const;
|
||||||
/// Sets the peer's host name used for certificate validation.
|
/// Returns the peer's X509 certificate.
|
||||||
|
///
|
||||||
|
/// Throws a SSLException if the peer did not
|
||||||
|
/// present a certificate.
|
||||||
|
|
||||||
|
void setPeerHostName(const std::string& hostName);
|
||||||
|
/// Sets the peer's host name used for certificate validation.
|
||||||
|
|
||||||
const std::string& getPeerHostName() const;
|
const std::string& getPeerHostName() const;
|
||||||
/// Returns the peer's host name used for certificate validation.
|
/// Returns the peer's host name used for certificate validation.
|
||||||
@@ -146,24 +187,102 @@ public:
|
|||||||
|
|
||||||
static SecureStreamSocket attach(const StreamSocket& streamSocket, Context::Ptr pContext);
|
static SecureStreamSocket attach(const StreamSocket& streamSocket, Context::Ptr pContext);
|
||||||
/// Creates a SecureStreamSocket over an existing socket
|
/// Creates a SecureStreamSocket over an existing socket
|
||||||
/// connection. The given StreamSocket must be connected.
|
/// connection. The given StreamSocket must be connected.
|
||||||
/// A SSL handshake will be performed.
|
/// A SSL handshake will be performed.
|
||||||
|
|
||||||
static SecureStreamSocket attach(const StreamSocket& streamSocket, const std::string& peerHostName);
|
static SecureStreamSocket attach(const StreamSocket& streamSocket, Context::Ptr pContext, Session::Ptr pSession);
|
||||||
/// Creates a SecureStreamSocket over an existing socket
|
/// Creates a SecureStreamSocket over an existing socket
|
||||||
/// connection. The given StreamSocket must be connected.
|
/// connection. The given StreamSocket must be connected.
|
||||||
|
/// A SSL handshake will be performed.
|
||||||
|
///
|
||||||
|
/// The given Session is reused, if possible (client session
|
||||||
|
/// caching is enabled for the given Context, and the server
|
||||||
|
/// agrees to reuse the session).
|
||||||
|
|
||||||
|
static SecureStreamSocket attach(const StreamSocket& streamSocket, const std::string& peerHostName);
|
||||||
|
/// Creates a SecureStreamSocket over an existing socket
|
||||||
|
/// connection. The given StreamSocket must be connected.
|
||||||
/// A SSL handshake will be performed.
|
/// A SSL handshake will be performed.
|
||||||
|
|
||||||
static SecureStreamSocket attach(const StreamSocket& streamSocket, const std::string& peerHostName, Context::Ptr pContext);
|
static SecureStreamSocket attach(const StreamSocket& streamSocket, const std::string& peerHostName, Context::Ptr pContext);
|
||||||
/// Creates a SecureStreamSocket over an existing socket
|
/// Creates a SecureStreamSocket over an existing socket
|
||||||
/// connection. The given StreamSocket must be connected.
|
/// connection. The given StreamSocket must be connected.
|
||||||
/// A SSL handshake will be performed.
|
/// A SSL handshake will be performed.
|
||||||
|
|
||||||
Context::Ptr context() const;
|
static SecureStreamSocket attach(const StreamSocket& streamSocket, const std::string& peerHostName, Context::Ptr pContext, Session::Ptr pSession);
|
||||||
/// Returns the SSL context used by this socket.
|
/// Creates a SecureStreamSocket over an existing socket
|
||||||
|
/// connection. The given StreamSocket must be connected.
|
||||||
|
/// A SSL handshake will be performed.
|
||||||
|
///
|
||||||
|
/// The given Session is reused, if possible (client session
|
||||||
|
/// caching is enabled for the given Context, and the server
|
||||||
|
/// agrees to reuse the session).
|
||||||
|
|
||||||
|
Context::Ptr context() const;
|
||||||
|
/// Returns the SSL context used by this socket.
|
||||||
|
|
||||||
|
void setLazyHandshake(bool flag = true);
|
||||||
|
/// Enable lazy SSL handshake. If enabled, the SSL handshake
|
||||||
|
/// will be performed the first time date is sent or
|
||||||
|
/// received over the connection.
|
||||||
|
|
||||||
|
bool getLazyHandshake() const;
|
||||||
|
/// Returns true if setLazyHandshake(true) has been called.
|
||||||
|
|
||||||
|
void verifyPeerCertificate();
|
||||||
|
/// Performs post-connect (or post-accept) peer certificate validation,
|
||||||
|
/// using the peer host name set with setPeerHostName(), or the peer's
|
||||||
|
/// IP address string if no peer host name has been set.
|
||||||
|
///
|
||||||
|
/// Should only be used for non-blocking connections, after the
|
||||||
|
/// initial SSL handshake has been performed (see completeHandshake()).
|
||||||
|
|
||||||
|
void verifyPeerCertificate(const std::string& hostName);
|
||||||
|
/// Performs post-connect (or post-accept) peer certificate validation
|
||||||
|
/// using the given host name.
|
||||||
|
///
|
||||||
|
/// Should only be used for non-blocking connections, after the
|
||||||
|
/// initial SSL handshake has been performed (see completeHandshake()).
|
||||||
|
|
||||||
|
int completeHandshake();
|
||||||
|
/// Completes the SSL handshake.
|
||||||
|
///
|
||||||
|
/// If the SSL connection was the result of an accept(),
|
||||||
|
/// the server-side handshake is completed, otherwise
|
||||||
|
/// a client-side handshake is performed.
|
||||||
|
///
|
||||||
|
/// Returns 1 if the handshake was successful, ERR_SSL_WANT_READ or
|
||||||
|
/// ERR_SSL_WANT_WRITE if more data is required to complete the
|
||||||
|
/// handshake. In this case, completeHandshake() should be called
|
||||||
|
/// again, after the necessary condition has been met.
|
||||||
|
|
||||||
|
Session::Ptr currentSession();
|
||||||
|
/// Returns the SSL session of the current connection,
|
||||||
|
/// for reuse in a future connection (if session caching
|
||||||
|
/// is enabled).
|
||||||
|
///
|
||||||
|
/// If no connection is established, returns null.
|
||||||
|
|
||||||
|
void useSession(Session::Ptr pSession);
|
||||||
|
/// Sets the SSL session to use for the next
|
||||||
|
/// connection. Setting a previously saved Session
|
||||||
|
/// object is necessary to enable session caching.
|
||||||
|
///
|
||||||
|
/// To remove the currently set session, a null pointer
|
||||||
|
/// can be given.
|
||||||
|
///
|
||||||
|
/// Must be called before connect() to be effective.
|
||||||
|
|
||||||
|
bool sessionWasReused();
|
||||||
|
/// Returns true iff a reused session was negotiated during
|
||||||
|
/// the handshake.
|
||||||
|
|
||||||
|
void abort();
|
||||||
|
/// Aborts the SSL connection by closing the underlying
|
||||||
|
/// TCP connection. No orderly SSL shutdown is performed.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SecureStreamSocket(SocketImpl* pImpl);
|
SecureStreamSocket(SocketImpl* pImpl);
|
||||||
|
|
||||||
friend class SecureServerSocket;
|
friend class SecureServerSocket;
|
||||||
};
|
};
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
// Definition of the SecureStreamSocketImpl class.
|
// Definition of the SecureStreamSocketImpl class.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@@ -63,15 +63,12 @@ public:
|
|||||||
|
|
||||||
SocketImpl* acceptConnection(SocketAddress& clientAddr);
|
SocketImpl* acceptConnection(SocketAddress& clientAddr);
|
||||||
/// Not supported by a SecureStreamSocket.
|
/// Not supported by a SecureStreamSocket.
|
||||||
///
|
///
|
||||||
/// Throws a Poco::InvalidAccessException.
|
/// Throws a Poco::InvalidAccessException.
|
||||||
|
|
||||||
void acceptSSL();
|
void connect(const SocketAddress& address);
|
||||||
/// Performs a SSL server-side handshake.
|
/// Initializes the socket and establishes a connection to
|
||||||
|
/// the TCP server at the given address.
|
||||||
void connect(const SocketAddress& address);
|
|
||||||
/// Initializes the socket and establishes a connection to
|
|
||||||
/// the TCP server at the given address.
|
|
||||||
///
|
///
|
||||||
/// Can also be used for UDP sockets. In this case, no
|
/// Can also be used for UDP sockets. In this case, no
|
||||||
/// connection is established. Instead, incoming and outgoing
|
/// connection is established. Instead, incoming and outgoing
|
||||||
@@ -83,15 +80,12 @@ public:
|
|||||||
|
|
||||||
void connectNB(const SocketAddress& address);
|
void connectNB(const SocketAddress& address);
|
||||||
/// Initializes the socket and establishes a connection to
|
/// Initializes the socket and establishes a connection to
|
||||||
/// the TCP server at the given address. Prior to opening the
|
/// the TCP server at the given address. Prior to opening the
|
||||||
/// connection the socket is set to nonblocking mode.
|
/// connection the socket is set to nonblocking mode.
|
||||||
|
|
||||||
void connectSSL();
|
void bind(const SocketAddress& address, bool reuseAddress = false);
|
||||||
/// Performs a SSL client-side handshake on an already connected TCP socket.
|
/// Not supported by a SecureStreamSocket.
|
||||||
|
///
|
||||||
void bind(const SocketAddress& address, bool reuseAddress = false);
|
|
||||||
/// Not supported by a SecureStreamSocket.
|
|
||||||
///
|
|
||||||
/// Throws a Poco::InvalidAccessException.
|
/// Throws a Poco::InvalidAccessException.
|
||||||
|
|
||||||
void listen(int backlog = 64);
|
void listen(int backlog = 64);
|
||||||
@@ -127,12 +121,20 @@ public:
|
|||||||
|
|
||||||
void sendUrgent(unsigned char data);
|
void sendUrgent(unsigned char data);
|
||||||
/// Not supported by a SecureStreamSocket.
|
/// Not supported by a SecureStreamSocket.
|
||||||
///
|
///
|
||||||
/// Throws a Poco::InvalidAccessException.
|
/// Throws a Poco::InvalidAccessException.
|
||||||
|
|
||||||
void shutdownReceive();
|
int available();
|
||||||
/// Shuts down the receiving part of the socket connection.
|
/// Returns the number of bytes available that can be read
|
||||||
///
|
/// without causing the socket to block.
|
||||||
|
///
|
||||||
|
/// For an SSL connection, returns the number of bytes that
|
||||||
|
/// can be read from the currently buffered SSL record,
|
||||||
|
/// before a new record is read from the underlying socket.
|
||||||
|
|
||||||
|
void shutdownReceive();
|
||||||
|
/// Shuts down the receiving part of the socket connection.
|
||||||
|
///
|
||||||
/// Since SSL does not support a half shutdown, this does
|
/// Since SSL does not support a half shutdown, this does
|
||||||
/// nothing.
|
/// nothing.
|
||||||
|
|
||||||
@@ -142,24 +144,89 @@ public:
|
|||||||
/// Since SSL does not support a half shutdown, this does
|
/// Since SSL does not support a half shutdown, this does
|
||||||
/// nothing.
|
/// nothing.
|
||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
/// Shuts down the SSL connection.
|
/// Shuts down the SSL connection.
|
||||||
|
|
||||||
void setPeerHostName(const std::string& hostName);
|
void abort();
|
||||||
/// Sets the peer host name for certificate validation purposes.
|
/// Aborts the connection by closing the underlying
|
||||||
|
/// TCP connection. No orderly SSL shutdown is performed.
|
||||||
|
|
||||||
const std::string& getPeerHostName() const;
|
bool secure() const;
|
||||||
/// Returns the peer host name.
|
/// Returns true iff the socket's connection is secure
|
||||||
|
/// (using SSL or TLS).
|
||||||
|
|
||||||
X509Certificate peerCertificate() const;
|
void setPeerHostName(const std::string& hostName);
|
||||||
/// Returns the peer's X509 certificate.
|
/// Sets the peer host name for certificate validation purposes.
|
||||||
|
|
||||||
Context::Ptr context() const;
|
const std::string& getPeerHostName() const;
|
||||||
/// Returns the SSL context used by this socket.
|
/// Returns the peer host name.
|
||||||
|
|
||||||
|
bool havePeerCertificate() const;
|
||||||
|
/// Returns true iff the peer has presented a
|
||||||
|
/// certificate.
|
||||||
|
|
||||||
|
X509Certificate peerCertificate() const;
|
||||||
|
/// Returns the peer's X509 certificate.
|
||||||
|
///
|
||||||
|
/// Throws a SSLException if the peer did not
|
||||||
|
/// present a certificate.
|
||||||
|
|
||||||
|
Context::Ptr context() const;
|
||||||
|
/// Returns the SSL context used by this socket.
|
||||||
|
|
||||||
|
void setLazyHandshake(bool flag = true);
|
||||||
|
/// Enable lazy SSL handshake. If enabled, the SSL handshake
|
||||||
|
/// will be performed the first time date is sent or
|
||||||
|
/// received over the connection.
|
||||||
|
|
||||||
|
bool getLazyHandshake() const;
|
||||||
|
/// Returns true if setLazyHandshake(true) has been called.
|
||||||
|
|
||||||
|
void verifyPeerCertificate();
|
||||||
|
/// Performs post-connect (or post-accept) peer certificate validation,
|
||||||
|
/// using the peer's IP address as host name.
|
||||||
|
|
||||||
|
void verifyPeerCertificate(const std::string& hostName);
|
||||||
|
/// Performs post-connect (or post-accept) peer certificate validation
|
||||||
|
/// using the given host name.
|
||||||
|
|
||||||
|
int completeHandshake();
|
||||||
|
/// Completes the SSL handshake.
|
||||||
|
///
|
||||||
|
/// If the SSL connection was the result of an accept(),
|
||||||
|
/// the server-side handshake is completed, otherwise
|
||||||
|
/// a client-side handshake is performed.
|
||||||
|
|
||||||
|
Session::Ptr currentSession();
|
||||||
|
/// Returns the SSL session of the current connection,
|
||||||
|
/// for reuse in a future connection (if session caching
|
||||||
|
/// is enabled).
|
||||||
|
///
|
||||||
|
/// If no connection is established, returns null.
|
||||||
|
|
||||||
|
void useSession(Session::Ptr pSession);
|
||||||
|
/// Sets the SSL session to use for the next
|
||||||
|
/// connection. Setting a previously saved Session
|
||||||
|
/// object is necessary to enable session caching.
|
||||||
|
///
|
||||||
|
/// To remove the currently set session, a null pointer
|
||||||
|
/// can be given.
|
||||||
|
///
|
||||||
|
/// Must be called before connect() to be effective.
|
||||||
|
|
||||||
|
bool sessionWasReused();
|
||||||
|
/// Returns true iff a reused session was negotiated during
|
||||||
|
/// the handshake.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~SecureStreamSocketImpl();
|
void acceptSSL();
|
||||||
/// Destroys the SecureStreamSocketImpl.
|
/// Performs a SSL server-side handshake.
|
||||||
|
|
||||||
|
void connectSSL();
|
||||||
|
/// Performs a SSL client-side handshake on an already connected TCP socket.
|
||||||
|
|
||||||
|
~SecureStreamSocketImpl();
|
||||||
|
/// Destroys the SecureStreamSocketImpl.
|
||||||
|
|
||||||
static int lastError();
|
static int lastError();
|
||||||
static void error();
|
static void error();
|
||||||
@@ -169,12 +236,13 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
SecureStreamSocketImpl(const SecureStreamSocketImpl&);
|
SecureStreamSocketImpl(const SecureStreamSocketImpl&);
|
||||||
SecureStreamSocketImpl& operator = (const SecureStreamSocketImpl&);
|
SecureStreamSocketImpl& operator = (const SecureStreamSocketImpl&);
|
||||||
|
|
||||||
SecureSocketImpl _impl;
|
SecureSocketImpl _impl;
|
||||||
std::string _peerHostName;
|
bool _lazyHandshake;
|
||||||
|
|
||||||
friend class SecureSocketImpl;
|
friend class SecureSocketImpl;
|
||||||
|
friend class SecureStreamSocket;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -183,7 +251,13 @@ private:
|
|||||||
//
|
//
|
||||||
inline const std::string& SecureStreamSocketImpl::getPeerHostName() const
|
inline const std::string& SecureStreamSocketImpl::getPeerHostName() const
|
||||||
{
|
{
|
||||||
return _peerHostName;
|
return _impl.getPeerHostName();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline void SecureStreamSocketImpl::setPeerHostName(const std::string& peerHostName)
|
||||||
|
{
|
||||||
|
_impl.setPeerHostName(peerHostName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -193,9 +267,27 @@ inline Context::Ptr SecureStreamSocketImpl::context() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Session::Ptr SecureStreamSocketImpl::currentSession()
|
||||||
|
{
|
||||||
|
return _impl.currentSession();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline void SecureStreamSocketImpl::useSession(Session::Ptr pSession)
|
||||||
|
{
|
||||||
|
_impl.useSession(pSession);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool SecureStreamSocketImpl::sessionWasReused()
|
||||||
|
{
|
||||||
|
return _impl.sessionWasReused();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline int SecureStreamSocketImpl::lastError()
|
inline int SecureStreamSocketImpl::lastError()
|
||||||
{
|
{
|
||||||
return SocketImpl::lastError();
|
return SocketImpl::lastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
101
NetSSL_OpenSSL/include/Poco/Net/Session.h
Normal file
101
NetSSL_OpenSSL/include/Poco/Net/Session.h
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
//
|
||||||
|
// Session.h
|
||||||
|
//
|
||||||
|
// $Id: //poco/1.4/NetSSL_OpenSSL/include/Poco/Net/Session.h#1 $
|
||||||
|
//
|
||||||
|
// Library: NetSSL_OpenSSL
|
||||||
|
// Package: SSLCore
|
||||||
|
// Module: Session
|
||||||
|
//
|
||||||
|
// Definition of the Session class.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2010, Applied Informatics Software Engineering GmbH.
|
||||||
|
// and Contributors.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
|
// obtaining a copy of the software and accompanying documentation covered by
|
||||||
|
// this license (the "Software") to use, reproduce, display, distribute,
|
||||||
|
// execute, and transmit the Software, and to prepare derivative works of the
|
||||||
|
// Software, and to permit third-parties to whom the Software is furnished to
|
||||||
|
// do so, all subject to the following:
|
||||||
|
//
|
||||||
|
// The copyright notices in the Software and this entire statement, including
|
||||||
|
// the above license grant, this restriction and the following disclaimer,
|
||||||
|
// must be included in all copies of the Software, in whole or in part, and
|
||||||
|
// all derivative works of the Software, unless such copies or derivative
|
||||||
|
// works are solely in the form of machine-executable object code generated by
|
||||||
|
// a source language processor.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||||
|
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||||
|
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||||
|
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NetSSL_Session_INCLUDED
|
||||||
|
#define NetSSL_Session_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
|
#include "Poco/Net/NetSSL.h"
|
||||||
|
#include "Poco/RefCountedObject.h"
|
||||||
|
#include "Poco/AutoPtr.h"
|
||||||
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace Poco {
|
||||||
|
namespace Net {
|
||||||
|
|
||||||
|
|
||||||
|
class NetSSL_API Session: public Poco::RefCountedObject
|
||||||
|
/// This class encapsulates a SSL session object
|
||||||
|
/// used with session caching on the client side.
|
||||||
|
///
|
||||||
|
/// For session caching to work, a client must
|
||||||
|
/// save the session object from an existing connection,
|
||||||
|
/// if it wants to reuse it with a future connection.
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef Poco::AutoPtr<Session> Ptr;
|
||||||
|
|
||||||
|
SSL_SESSION* sslSession() const;
|
||||||
|
/// Returns the stored OpenSSL SSL_SESSION object.
|
||||||
|
|
||||||
|
protected:
|
||||||
|
Session(SSL_SESSION* pSession);
|
||||||
|
/// Creates a new Session object, using the given
|
||||||
|
/// SSL_SESSION object.
|
||||||
|
///
|
||||||
|
/// The SSL_SESSION's reference count is not changed.
|
||||||
|
|
||||||
|
~Session();
|
||||||
|
/// Destroys the Session.
|
||||||
|
///
|
||||||
|
/// Calls SSL_SESSION_free() on the stored
|
||||||
|
/// SSL_SESSION object.
|
||||||
|
|
||||||
|
private:
|
||||||
|
Session();
|
||||||
|
|
||||||
|
SSL_SESSION* _pSession;
|
||||||
|
|
||||||
|
friend class SecureSocketImpl;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// inlines
|
||||||
|
//
|
||||||
|
inline SSL_SESSION* Session::sslSession() const
|
||||||
|
{
|
||||||
|
return _pSession;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} } // namespace Poco::Net
|
||||||
|
|
||||||
|
|
||||||
|
#endif // NetSSL_Session_INCLUDED
|
@@ -41,11 +41,11 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Poco/Net/NetSSL.h"
|
#include "Poco/Net/NetSSL.h"
|
||||||
|
#include "Poco/Net/SocketDefs.h"
|
||||||
#include "Poco/Crypto/X509Certificate.h"
|
#include "Poco/Crypto/X509Certificate.h"
|
||||||
#include "Poco/DateTime.h"
|
#include "Poco/DateTime.h"
|
||||||
#include "Poco/SharedPtr.h"
|
#include "Poco/SharedPtr.h"
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <openssl/ssl.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
@@ -70,32 +70,44 @@ public:
|
|||||||
|
|
||||||
explicit X509Certificate(X509* pCert);
|
explicit X509Certificate(X509* pCert);
|
||||||
/// Creates the X509Certificate from an existing
|
/// Creates the X509Certificate from an existing
|
||||||
/// OpenSSL certificate. Ownership is taken of
|
/// OpenSSL certificate. Ownership is taken of
|
||||||
/// the certificate.
|
/// the certificate.
|
||||||
|
|
||||||
X509Certificate(const Poco::Crypto::X509Certificate& cert);
|
X509Certificate(X509* pCert, bool shared);
|
||||||
/// Creates the certificate by copying another one.
|
/// Creates the X509Certificate from an existing
|
||||||
|
/// OpenSSL certificate. Ownership is taken of
|
||||||
|
/// the certificate. If shared is true, the
|
||||||
|
/// certificate's reference count is incremented.
|
||||||
|
|
||||||
|
X509Certificate(const Poco::Crypto::X509Certificate& cert);
|
||||||
|
/// Creates the certificate by copying another one.
|
||||||
|
|
||||||
X509Certificate& operator = (const Poco::Crypto::X509Certificate& cert);
|
X509Certificate& operator = (const Poco::Crypto::X509Certificate& cert);
|
||||||
/// Assigns a certificate.
|
/// Assigns a certificate.
|
||||||
|
|
||||||
~X509Certificate();
|
~X509Certificate();
|
||||||
/// Destroys the X509Certificate.
|
/// Destroys the X509Certificate.
|
||||||
|
|
||||||
long verify(const std::string& hostName) const;
|
bool verify(const std::string& hostName) const;
|
||||||
/// Verifies the validity of the certificate against the host name.
|
/// Verifies the validity of the certificate against the host name.
|
||||||
///
|
///
|
||||||
/// Returns X509_V_OK if verification succeeded, or an
|
/// For this check to be successful, the certificate must contain
|
||||||
/// error code (X509_V_ERR_APPLICATION_VERIFICATION) otherwise.
|
/// a domain name that matches the domain name
|
||||||
|
/// of the host.
|
||||||
|
///
|
||||||
|
/// Returns true if verification succeeded, or false otherwise.
|
||||||
|
|
||||||
static long verify(const Poco::Crypto::X509Certificate& cert, const std::string& hostName);
|
static bool verify(const Poco::Crypto::X509Certificate& cert, const std::string& hostName);
|
||||||
/// Verifies the validity of the certificate against the host name.
|
/// Verifies the validity of the certificate against the host name.
|
||||||
///
|
///
|
||||||
/// Returns X509_V_OK if verification succeeded, or an
|
/// For this check to be successful, the certificate must contain
|
||||||
/// error code (X509_V_ERR_APPLICATION_VERIFICATION) otherwise.
|
/// a domain name that matches the domain name
|
||||||
|
/// of the host.
|
||||||
|
///
|
||||||
|
/// Returns true if verification succeeded, or false otherwise.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static bool containsWildcards(const std::string& commonName);
|
static bool containsWildcards(const std::string& commonName);
|
||||||
static bool matchByAlias(const std::string& alias, const HostEntry& heData);
|
static bool matchByAlias(const std::string& alias, const HostEntry& heData);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -0,0 +1,302 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="debug_shared|Win32">
|
||||||
|
<Configuration>debug_shared</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_md|Win32">
|
||||||
|
<Configuration>debug_static_md</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_mt|Win32">
|
||||||
|
<Configuration>debug_static_mt</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_shared|Win32">
|
||||||
|
<Configuration>release_shared</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_md|Win32">
|
||||||
|
<Configuration>release_static_md</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_mt|Win32">
|
||||||
|
<Configuration>release_static_mt</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectName>HTTPSTimeServer</ProjectName>
|
||||||
|
<ProjectGuid>{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}</ProjectGuid>
|
||||||
|
<RootNamespace>HTTPSTimeServer</RootNamespace>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
|
||||||
|
<ImportGroup Label="ExtensionSettings"/>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros"/>
|
||||||
|
<PropertyGroup>
|
||||||
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">bin\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">bin\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">bin\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">bin\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">bin\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">bin\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">false</LinkIncremental>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">HTTPSTimeServerd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">HTTPSTimeServerd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">HTTPSTimeServerd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">HTTPSTimeServer</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">HTTPSTimeServer</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">HTTPSTimeServer</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\HTTPSTimeServerd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin\HTTPSTimeServerd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\HTTPSTimeServer.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mtd.lib;ssleay32mtd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_mt\HTTPSTimeServerd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin\static_mt\HTTPSTimeServerd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mt.lib;ssleay32mt.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_mt\HTTPSTimeServer.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_md\HTTPSTimeServerd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin\static_md\HTTPSTimeServerd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_md\HTTPSTimeServer.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="HTTPSTimeServer.properties"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\HTTPSTimeServer.cpp"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
|
||||||
|
<ImportGroup Label="ExtensionTargets"/>
|
||||||
|
</Project>
|
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Configuration Files">
|
||||||
|
<UniqueIdentifier>{a40416ad-36e4-4285-b9f5-a53af5be9463}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{1aac5164-77a5-4616-9171-444d4cd878d1}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="HTTPSTimeServer.properties">
|
||||||
|
<Filter>Configuration Files</Filter>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\HTTPSTimeServer.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
@@ -0,0 +1,302 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="debug_shared|x64">
|
||||||
|
<Configuration>debug_shared</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_md|x64">
|
||||||
|
<Configuration>debug_static_md</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_mt|x64">
|
||||||
|
<Configuration>debug_static_mt</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_shared|x64">
|
||||||
|
<Configuration>release_shared</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_md|x64">
|
||||||
|
<Configuration>release_static_md</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_mt|x64">
|
||||||
|
<Configuration>release_static_mt</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectName>HTTPSTimeServer</ProjectName>
|
||||||
|
<ProjectGuid>{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}</ProjectGuid>
|
||||||
|
<RootNamespace>HTTPSTimeServer</RootNamespace>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
|
||||||
|
<ImportGroup Label="ExtensionSettings"/>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros"/>
|
||||||
|
<PropertyGroup>
|
||||||
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">bin64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">bin64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">bin64\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">bin64\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">bin64\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">bin64\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">false</LinkIncremental>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">HTTPSTimeServerd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">HTTPSTimeServerd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">HTTPSTimeServerd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">HTTPSTimeServer</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">HTTPSTimeServer</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">HTTPSTimeServer</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\HTTPSTimeServerd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin64\HTTPSTimeServerd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\HTTPSTimeServer.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mtd.lib;ssleay32mtd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_mt\HTTPSTimeServerd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin64\static_mt\HTTPSTimeServerd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mt.lib;ssleay32mt.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_mt\HTTPSTimeServer.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_md\HTTPSTimeServerd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin64\static_md\HTTPSTimeServerd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_md\HTTPSTimeServer.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="HTTPSTimeServer.properties"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\HTTPSTimeServer.cpp"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
|
||||||
|
<ImportGroup Label="ExtensionTargets"/>
|
||||||
|
</Project>
|
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Configuration Files">
|
||||||
|
<UniqueIdentifier>{11730e81-39a3-49ce-9a12-fc7cc81b3677}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{604b0ee0-6702-4290-903d-d49071db2abc}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="HTTPSTimeServer.properties">
|
||||||
|
<Filter>Configuration Files</Filter>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\HTTPSTimeServer.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// TimeServer.cpp
|
// TimeServer.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/NetSSL_OpenSSL/samples/HTTPSTimeServer/src/HTTPSTimeServer.cpp#6 $
|
// $Id: //poco/1.4/NetSSL_OpenSSL/samples/HTTPSTimeServer/src/HTTPSTimeServer.cpp#2 $
|
||||||
//
|
//
|
||||||
// This sample demonstrates the HTTPServer and related classes.
|
// This sample demonstrates the HTTPServer and related classes.
|
||||||
//
|
//
|
||||||
@@ -36,10 +36,12 @@
|
|||||||
#include "Poco/Net/HTTPRequestHandler.h"
|
#include "Poco/Net/HTTPRequestHandler.h"
|
||||||
#include "Poco/Net/HTTPRequestHandlerFactory.h"
|
#include "Poco/Net/HTTPRequestHandlerFactory.h"
|
||||||
#include "Poco/Net/HTTPServerParams.h"
|
#include "Poco/Net/HTTPServerParams.h"
|
||||||
#include "Poco/Net/HTTPServerRequest.h"
|
#include "Poco/Net/HTTPServerRequestImpl.h"
|
||||||
#include "Poco/Net/HTTPServerResponse.h"
|
#include "Poco/Net/HTTPServerResponse.h"
|
||||||
#include "Poco/Net/HTTPServerParams.h"
|
#include "Poco/Net/HTTPServerParams.h"
|
||||||
|
#include "Poco/Net/SecureStreamSocket.h"
|
||||||
#include "Poco/Net/SecureServerSocket.h"
|
#include "Poco/Net/SecureServerSocket.h"
|
||||||
|
#include "Poco/Net/X509Certificate.h"
|
||||||
#include "Poco/Timestamp.h"
|
#include "Poco/Timestamp.h"
|
||||||
#include "Poco/DateTimeFormatter.h"
|
#include "Poco/DateTimeFormatter.h"
|
||||||
#include "Poco/DateTimeFormat.h"
|
#include "Poco/DateTimeFormat.h"
|
||||||
@@ -56,10 +58,13 @@
|
|||||||
|
|
||||||
|
|
||||||
using Poco::Net::SecureServerSocket;
|
using Poco::Net::SecureServerSocket;
|
||||||
|
using Poco::Net::SecureStreamSocket;
|
||||||
using Poco::Net::HTTPRequestHandler;
|
using Poco::Net::HTTPRequestHandler;
|
||||||
using Poco::Net::HTTPRequestHandlerFactory;
|
using Poco::Net::HTTPRequestHandlerFactory;
|
||||||
using Poco::Net::HTTPServer;
|
using Poco::Net::HTTPServer;
|
||||||
using Poco::Net::HTTPServerRequest;
|
using Poco::Net::HTTPServerRequest;
|
||||||
|
using Poco::Net::HTTPServerRequestImpl;
|
||||||
|
using Poco::Net::X509Certificate;
|
||||||
using Poco::Net::HTTPServerResponse;
|
using Poco::Net::HTTPServerResponse;
|
||||||
using Poco::Net::HTTPServerParams;
|
using Poco::Net::HTTPServerParams;
|
||||||
using Poco::Timestamp;
|
using Poco::Timestamp;
|
||||||
@@ -90,11 +95,22 @@ public:
|
|||||||
|
|
||||||
void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
|
void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
|
||||||
{
|
{
|
||||||
Application& app = Application::instance();
|
Application& app = Application::instance();
|
||||||
app.logger().information("Request from " + request.clientAddress().toString());
|
app.logger().information("Request from " + request.clientAddress().toString());
|
||||||
|
|
||||||
Timestamp now;
|
SecureStreamSocket socket = static_cast<HTTPServerRequestImpl&>(request).socket();
|
||||||
std::string dt(DateTimeFormatter::format(now, _format));
|
if (socket.havePeerCertificate())
|
||||||
|
{
|
||||||
|
X509Certificate cert = socket.peerCertificate();
|
||||||
|
app.logger().information("Client certificate: " + cert.subjectName());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.logger().information("No client certificate available.");
|
||||||
|
}
|
||||||
|
|
||||||
|
Timestamp now;
|
||||||
|
std::string dt(DateTimeFormatter::format(now, _format));
|
||||||
|
|
||||||
response.setChunkedTransferEncoding(true);
|
response.setChunkedTransferEncoding(true);
|
||||||
response.setContentType("text/html");
|
response.setContentType("text/html");
|
||||||
@@ -145,21 +161,23 @@ class HTTPSTimeServer: public Poco::Util::ServerApplication
|
|||||||
/// To use the sample configuration file (HTTPTimeServer.properties),
|
/// To use the sample configuration file (HTTPTimeServer.properties),
|
||||||
/// copy the file to the directory where the HTTPTimeServer executable
|
/// copy the file to the directory where the HTTPTimeServer executable
|
||||||
/// resides. If you start the debug version of the HTTPTimeServer
|
/// resides. If you start the debug version of the HTTPTimeServer
|
||||||
/// (HTTPTimeServerd[.exe]), you must also create a copy of the configuration
|
/// (HTTPTimeServerd[.exe]), you must also create a copy of the configuration
|
||||||
/// file named HTTPTimeServerd.properties. In the configuration file, you
|
/// file named HTTPTimeServerd.properties. In the configuration file, you
|
||||||
/// can specify the port on which the server is listening (default
|
/// can specify the port on which the server is listening (default
|
||||||
/// 9980) and the format of the date/time string sent back to the client.
|
/// 9443) and the format of the date/time string sent back to the client.
|
||||||
///
|
///
|
||||||
/// To test the TimeServer you can use any web browser (https://localhost:9980/).
|
/// To test the TimeServer you can use any web browser (https://localhost:9443/).
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HTTPSTimeServer(): _helpRequested(false)
|
HTTPSTimeServer(): _helpRequested(false)
|
||||||
{
|
{
|
||||||
}
|
Poco::Net::initializeSSL();
|
||||||
|
}
|
||||||
|
|
||||||
~HTTPSTimeServer()
|
~HTTPSTimeServer()
|
||||||
{
|
{
|
||||||
}
|
Poco::Net::uninitializeSSL();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initialize(Application& self)
|
void initialize(Application& self)
|
||||||
@@ -206,14 +224,14 @@ protected:
|
|||||||
{
|
{
|
||||||
displayHelp();
|
displayHelp();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// get parameters from configuration file
|
// get parameters from configuration file
|
||||||
unsigned short port = (unsigned short) config().getInt("HTTPTimeServer.port", 9980);
|
unsigned short port = (unsigned short) config().getInt("HTTPSTimeServer.port", 9443);
|
||||||
std::string format(config().getString("HTTPTimeServer.format", DateTimeFormat::SORTABLE_FORMAT));
|
std::string format(config().getString("HTTPSTimeServer.format", DateTimeFormat::SORTABLE_FORMAT));
|
||||||
|
|
||||||
// set-up a server socket
|
// set-up a server socket
|
||||||
SecureServerSocket svs(port);
|
SecureServerSocket svs(port);
|
||||||
// set-up a HTTPServer instance
|
// set-up a HTTPServer instance
|
||||||
HTTPServer srv(new TimeRequestHandlerFactory(format), svs, new HTTPServerParams);
|
HTTPServer srv(new TimeRequestHandlerFactory(format), svs, new HTTPServerParams);
|
||||||
// start the HTTPServer
|
// start the HTTPServer
|
||||||
|
299
NetSSL_OpenSSL/samples/download/download_vs100.vcxproj
Normal file
299
NetSSL_OpenSSL/samples/download/download_vs100.vcxproj
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="debug_shared|Win32">
|
||||||
|
<Configuration>debug_shared</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_md|Win32">
|
||||||
|
<Configuration>debug_static_md</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_mt|Win32">
|
||||||
|
<Configuration>debug_static_mt</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_shared|Win32">
|
||||||
|
<Configuration>release_shared</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_md|Win32">
|
||||||
|
<Configuration>release_static_md</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_mt|Win32">
|
||||||
|
<Configuration>release_static_mt</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectName>download</ProjectName>
|
||||||
|
<ProjectGuid>{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}</ProjectGuid>
|
||||||
|
<RootNamespace>download</RootNamespace>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
|
||||||
|
<ImportGroup Label="ExtensionSettings"/>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros"/>
|
||||||
|
<PropertyGroup>
|
||||||
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">bin\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">bin\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">bin\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">bin\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">bin\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">bin\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">false</LinkIncremental>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">downloadd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">downloadd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">downloadd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">download</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">download</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">download</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\downloadd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin\downloadd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\download.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mtd.lib;ssleay32mtd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_mt\downloadd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin\static_mt\downloadd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mt.lib;ssleay32mt.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_mt\download.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_md\downloadd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin\static_md\downloadd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_md\download.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\download.cpp"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
|
||||||
|
<ImportGroup Label="ExtensionTargets"/>
|
||||||
|
</Project>
|
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{d0347c7d-3fbe-4ac8-a7b0-b96f698bda52}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\download.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
299
NetSSL_OpenSSL/samples/download/download_x64_vs100.vcxproj
Normal file
299
NetSSL_OpenSSL/samples/download/download_x64_vs100.vcxproj
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="debug_shared|x64">
|
||||||
|
<Configuration>debug_shared</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_md|x64">
|
||||||
|
<Configuration>debug_static_md</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_mt|x64">
|
||||||
|
<Configuration>debug_static_mt</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_shared|x64">
|
||||||
|
<Configuration>release_shared</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_md|x64">
|
||||||
|
<Configuration>release_static_md</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_mt|x64">
|
||||||
|
<Configuration>release_static_mt</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectName>download</ProjectName>
|
||||||
|
<ProjectGuid>{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}</ProjectGuid>
|
||||||
|
<RootNamespace>download</RootNamespace>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
|
||||||
|
<ImportGroup Label="ExtensionSettings"/>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros"/>
|
||||||
|
<PropertyGroup>
|
||||||
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">bin64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">bin64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">bin64\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">bin64\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">bin64\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">bin64\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">false</LinkIncremental>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">downloadd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">downloadd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">downloadd</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">download</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">download</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">download</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\downloadd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin64\downloadd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\download.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mtd.lib;ssleay32mtd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_mt\downloadd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin64\static_mt\downloadd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mt.lib;ssleay32mt.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_mt\download.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_md\downloadd.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin64\static_md\downloadd.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>.\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Net\include;..\..\..\NetSSL_OpenSSL\include;..\..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_md\download.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\download.cpp"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
|
||||||
|
<ImportGroup Label="ExtensionTargets"/>
|
||||||
|
</Project>
|
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{dbd8c9fd-9fa3-498c-bf1c-cbbc9afe03e3}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\download.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
@@ -65,11 +65,27 @@ using Poco::Net::InvalidCertificateHandler;
|
|||||||
using Poco::Net::ConsoleCertificateHandler;
|
using Poco::Net::ConsoleCertificateHandler;
|
||||||
|
|
||||||
|
|
||||||
|
class SSLInitializer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SSLInitializer()
|
||||||
|
{
|
||||||
|
Poco::Net::initializeSSL();
|
||||||
|
}
|
||||||
|
|
||||||
|
~SSLInitializer()
|
||||||
|
{
|
||||||
|
Poco::Net::uninitializeSSL();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
HTTPStreamFactory::registerFactory();
|
SSLInitializer sslInitializer;
|
||||||
HTTPSStreamFactory::registerFactory();
|
HTTPStreamFactory::registerFactory();
|
||||||
FTPStreamFactory::registerFactory();
|
HTTPSStreamFactory::registerFactory();
|
||||||
|
FTPStreamFactory::registerFactory();
|
||||||
|
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
{
|
{
|
||||||
|
57
NetSSL_OpenSSL/samples/samples_vs100.sln
Normal file
57
NetSSL_OpenSSL/samples/samples_vs100.sln
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
|
# Visual Studio 2010
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "download", "download\download_vs100.vcxproj", "{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HTTPSTimeServer", "HTTPSTimeServer\HTTPSTimeServer_vs100.vcxproj", "{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
debug_shared|Win32 = debug_shared|Win32
|
||||||
|
release_shared|Win32 = release_shared|Win32
|
||||||
|
debug_static_mt|Win32 = debug_static_mt|Win32
|
||||||
|
release_static_mt|Win32 = release_static_mt|Win32
|
||||||
|
debug_static_md|Win32 = debug_static_md|Win32
|
||||||
|
release_static_md|Win32 = release_static_md|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_shared|Win32.Build.0 = debug_shared|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_shared|Win32.ActiveCfg = release_shared|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_shared|Win32.Build.0 = release_shared|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_shared|Win32.Deploy.0 = release_shared|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_md|Win32.Build.0 = release_static_md|Win32
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_shared|Win32.Build.0 = debug_shared|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_shared|Win32.ActiveCfg = release_shared|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_shared|Win32.Build.0 = release_shared|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_shared|Win32.Deploy.0 = release_shared|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_md|Win32.Build.0 = release_static_md|Win32
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
57
NetSSL_OpenSSL/samples/samples_x64_vs100.sln
Normal file
57
NetSSL_OpenSSL/samples/samples_x64_vs100.sln
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
|
# Visual Studio 2010
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "download", "download\download_x64_vs100.vcxproj", "{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HTTPSTimeServer", "HTTPSTimeServer\HTTPSTimeServer_x64_vs100.vcxproj", "{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
debug_shared|x64 = debug_shared|x64
|
||||||
|
release_shared|x64 = release_shared|x64
|
||||||
|
debug_static_mt|x64 = debug_static_mt|x64
|
||||||
|
release_static_mt|x64 = release_static_mt|x64
|
||||||
|
debug_static_md|x64 = debug_static_md|x64
|
||||||
|
release_static_md|x64 = release_static_md|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_shared|x64.ActiveCfg = debug_shared|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_shared|x64.Build.0 = debug_shared|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_shared|x64.Deploy.0 = debug_shared|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_shared|x64.ActiveCfg = release_shared|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_shared|x64.Build.0 = release_shared|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_shared|x64.Deploy.0 = release_shared|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_mt|x64.Build.0 = release_static_mt|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_mt|x64.Deploy.0 = release_static_mt|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_md|x64.Build.0 = debug_static_md|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.debug_static_md|x64.Deploy.0 = debug_static_md|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_md|x64.ActiveCfg = release_static_md|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_md|x64.Build.0 = release_static_md|x64
|
||||||
|
{D853F3D6-0D6F-3E8E-82C7-4216D7A21C4D}.release_static_md|x64.Deploy.0 = release_static_md|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_shared|x64.ActiveCfg = debug_shared|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_shared|x64.Build.0 = debug_shared|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_shared|x64.Deploy.0 = debug_shared|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_shared|x64.ActiveCfg = release_shared|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_shared|x64.Build.0 = release_shared|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_shared|x64.Deploy.0 = release_shared|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_mt|x64.Deploy.0 = debug_static_mt|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_mt|x64.Build.0 = release_static_mt|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_mt|x64.Deploy.0 = release_static_mt|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_md|x64.Build.0 = debug_static_md|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.debug_static_md|x64.Deploy.0 = debug_static_md|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_md|x64.ActiveCfg = release_static_md|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_md|x64.Build.0 = release_static_md|x64
|
||||||
|
{F8DE5054-3EC1-3FB4-9FE6-38EE974745A9}.release_static_md|x64.Deploy.0 = release_static_md|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
@@ -37,6 +37,7 @@
|
|||||||
#include "Poco/Net/CertificateHandlerFactoryMgr.h"
|
#include "Poco/Net/CertificateHandlerFactoryMgr.h"
|
||||||
#include "Poco/Net/ConsoleCertificateHandler.h"
|
#include "Poco/Net/ConsoleCertificateHandler.h"
|
||||||
#include "Poco/Net/AcceptCertificateHandler.h"
|
#include "Poco/Net/AcceptCertificateHandler.h"
|
||||||
|
#include "Poco/Net/RejectCertificateHandler.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
@@ -45,9 +46,9 @@ namespace Net {
|
|||||||
|
|
||||||
CertificateHandlerFactoryMgr::CertificateHandlerFactoryMgr()
|
CertificateHandlerFactoryMgr::CertificateHandlerFactoryMgr()
|
||||||
{
|
{
|
||||||
setFactory("ConsoleCertificateHandler", new CertificateHandlerFactoryImpl<ConsoleCertificateHandler>());
|
setFactory("ConsoleCertificateHandler", new CertificateHandlerFactoryImpl<ConsoleCertificateHandler>());
|
||||||
setFactory("AcceptCertificateHandler", new CertificateHandlerFactoryImpl<AcceptCertificateHandler>());
|
setFactory("AcceptCertificateHandler", new CertificateHandlerFactoryImpl<AcceptCertificateHandler>());
|
||||||
|
setFactory("RejectCertificateHandler", new CertificateHandlerFactoryImpl<RejectCertificateHandler>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
// Package: SSLCore
|
// Package: SSLCore
|
||||||
// Module: Context
|
// Module: Context
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@@ -38,7 +38,10 @@
|
|||||||
#include "Poco/Net/SSLManager.h"
|
#include "Poco/Net/SSLManager.h"
|
||||||
#include "Poco/Net/SSLException.h"
|
#include "Poco/Net/SSLException.h"
|
||||||
#include "Poco/Net/Utility.h"
|
#include "Poco/Net/Utility.h"
|
||||||
|
#include "Poco/Crypto/OpenSSLInitializer.h"
|
||||||
#include "Poco/File.h"
|
#include "Poco/File.h"
|
||||||
|
#include "Poco/Path.h"
|
||||||
|
#include "Poco/Timestamp.h"
|
||||||
#include <openssl/bio.h>
|
#include <openssl/bio.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
@@ -54,34 +57,45 @@ Context::Context(
|
|||||||
const std::string& privateKeyFile,
|
const std::string& privateKeyFile,
|
||||||
const std::string& certificateFile,
|
const std::string& certificateFile,
|
||||||
const std::string& caLocation,
|
const std::string& caLocation,
|
||||||
VerificationMode verificationMode,
|
VerificationMode verificationMode,
|
||||||
int verificationDepth,
|
int verificationDepth,
|
||||||
bool loadDefaultCAs,
|
bool loadDefaultCAs,
|
||||||
const std::string& cypherList):
|
const std::string& cipherList):
|
||||||
_usage(usage),
|
_usage(usage),
|
||||||
_mode(verificationMode),
|
_mode(verificationMode),
|
||||||
_pSSLContext(0)
|
_pSSLContext(0),
|
||||||
|
_extendedCertificateVerification(true)
|
||||||
{
|
{
|
||||||
_pSSLContext = SSL_CTX_new(SSLv23_method());
|
Poco::Crypto::OpenSSLInitializer::initialize();
|
||||||
if (!_pSSLContext)
|
|
||||||
{
|
|
||||||
unsigned long err = ERR_get_error();
|
|
||||||
throw SSLException("Cannot create SSL_CTX object", ERR_error_string(err, 0));
|
|
||||||
}
|
|
||||||
SSL_CTX_set_default_passwd_cb(_pSSLContext, &SSLManager::privateKeyPasswdCallback);
|
|
||||||
Utility::clearErrorStack();
|
|
||||||
|
|
||||||
int errCode = 0;
|
if (SSLManager::isFIPSEnabled())
|
||||||
if (!caLocation.empty())
|
{
|
||||||
{
|
_pSSLContext = SSL_CTX_new(TLSv1_method());
|
||||||
Poco::File aFile(caLocation);
|
}
|
||||||
if (aFile.isDirectory())
|
else
|
||||||
errCode = SSL_CTX_load_verify_locations(_pSSLContext, 0, caLocation.c_str());
|
{
|
||||||
else
|
_pSSLContext = SSL_CTX_new(SSLv23_method());
|
||||||
errCode = SSL_CTX_load_verify_locations(_pSSLContext, caLocation.c_str(), 0);
|
}
|
||||||
if (errCode != 1)
|
if (!_pSSLContext)
|
||||||
{
|
{
|
||||||
std::string msg = Utility::getLastError();
|
unsigned long err = ERR_get_error();
|
||||||
|
throw SSLException("Cannot create SSL_CTX object", ERR_error_string(err, 0));
|
||||||
|
}
|
||||||
|
SSL_CTX_set_default_passwd_cb(_pSSLContext, &SSLManager::privateKeyPassphraseCallback);
|
||||||
|
Utility::clearErrorStack();
|
||||||
|
SSL_CTX_set_options(_pSSLContext, SSL_OP_ALL);
|
||||||
|
|
||||||
|
int errCode = 0;
|
||||||
|
if (!caLocation.empty())
|
||||||
|
{
|
||||||
|
Poco::File aFile(caLocation);
|
||||||
|
if (aFile.isDirectory())
|
||||||
|
errCode = SSL_CTX_load_verify_locations(_pSSLContext, 0, Poco::Path::transcode(caLocation).c_str());
|
||||||
|
else
|
||||||
|
errCode = SSL_CTX_load_verify_locations(_pSSLContext, Poco::Path::transcode(caLocation).c_str(), 0);
|
||||||
|
if (errCode != 1)
|
||||||
|
{
|
||||||
|
std::string msg = Utility::getLastError();
|
||||||
SSL_CTX_free(_pSSLContext);
|
SSL_CTX_free(_pSSLContext);
|
||||||
throw SSLContextException(std::string("Cannot load CA file/directory at ") + caLocation, msg);
|
throw SSLContextException(std::string("Cannot load CA file/directory at ") + caLocation, msg);
|
||||||
}
|
}
|
||||||
@@ -98,41 +112,242 @@ Context::Context(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!privateKeyFile.empty())
|
if (!privateKeyFile.empty())
|
||||||
{
|
{
|
||||||
errCode = SSL_CTX_use_PrivateKey_file(_pSSLContext, privateKeyFile.c_str(), SSL_FILETYPE_PEM);
|
errCode = SSL_CTX_use_PrivateKey_file(_pSSLContext, Poco::Path::transcode(privateKeyFile).c_str(), SSL_FILETYPE_PEM);
|
||||||
if (errCode != 1)
|
if (errCode != 1)
|
||||||
{
|
{
|
||||||
std::string msg = Utility::getLastError();
|
std::string msg = Utility::getLastError();
|
||||||
SSL_CTX_free(_pSSLContext);
|
SSL_CTX_free(_pSSLContext);
|
||||||
throw SSLContextException(std::string("Error loading private key from file ") + privateKeyFile, msg);
|
throw SSLContextException(std::string("Error loading private key from file ") + privateKeyFile, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!certificateFile.empty())
|
if (!certificateFile.empty())
|
||||||
{
|
{
|
||||||
errCode = SSL_CTX_use_certificate_chain_file(_pSSLContext, certificateFile.c_str());
|
errCode = SSL_CTX_use_certificate_chain_file(_pSSLContext, Poco::Path::transcode(certificateFile).c_str());
|
||||||
if (errCode != 1)
|
if (errCode != 1)
|
||||||
{
|
{
|
||||||
std::string errMsg = Utility::getLastError();
|
std::string errMsg = Utility::getLastError();
|
||||||
SSL_CTX_free(_pSSLContext);
|
SSL_CTX_free(_pSSLContext);
|
||||||
throw SSLContextException(std::string("Error loading certificate from file ") + privateKeyFile, errMsg);
|
throw SSLContextException(std::string("Error loading certificate from file ") + certificateFile, errMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (usage == SERVER_USE)
|
||||||
|
SSL_CTX_set_verify(_pSSLContext, verificationMode, &SSLManager::verifyServerCallback);
|
||||||
|
else
|
||||||
|
SSL_CTX_set_verify(_pSSLContext, verificationMode, &SSLManager::verifyClientCallback);
|
||||||
|
|
||||||
|
SSL_CTX_set_cipher_list(_pSSLContext, cipherList.c_str());
|
||||||
|
SSL_CTX_set_verify_depth(_pSSLContext, verificationDepth);
|
||||||
|
SSL_CTX_set_mode(_pSSLContext, SSL_MODE_AUTO_RETRY);
|
||||||
|
SSL_CTX_set_session_cache_mode(_pSSLContext, SSL_SESS_CACHE_OFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Context::Context(
|
||||||
|
Usage usage,
|
||||||
|
const std::string& caLocation,
|
||||||
|
VerificationMode verificationMode,
|
||||||
|
int verificationDepth,
|
||||||
|
bool loadDefaultCAs,
|
||||||
|
const std::string& cipherList):
|
||||||
|
_usage(usage),
|
||||||
|
_mode(verificationMode),
|
||||||
|
_pSSLContext(0),
|
||||||
|
_extendedCertificateVerification(true)
|
||||||
|
{
|
||||||
|
Poco::Crypto::OpenSSLInitializer::initialize();
|
||||||
|
|
||||||
|
if (SSLManager::isFIPSEnabled())
|
||||||
|
{
|
||||||
|
_pSSLContext = SSL_CTX_new(TLSv1_method());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_pSSLContext = SSL_CTX_new(SSLv23_method());
|
||||||
|
}
|
||||||
|
if (!_pSSLContext)
|
||||||
|
{
|
||||||
|
unsigned long err = ERR_get_error();
|
||||||
|
throw SSLException("Cannot create SSL_CTX object", ERR_error_string(err, 0));
|
||||||
|
}
|
||||||
|
SSL_CTX_set_default_passwd_cb(_pSSLContext, &SSLManager::privateKeyPassphraseCallback);
|
||||||
|
Utility::clearErrorStack();
|
||||||
|
SSL_CTX_set_options(_pSSLContext, SSL_OP_ALL);
|
||||||
|
|
||||||
|
int errCode = 0;
|
||||||
|
if (!caLocation.empty())
|
||||||
|
{
|
||||||
|
Poco::File aFile(caLocation);
|
||||||
|
if (aFile.isDirectory())
|
||||||
|
errCode = SSL_CTX_load_verify_locations(_pSSLContext, 0, Poco::Path::transcode(caLocation).c_str());
|
||||||
|
else
|
||||||
|
errCode = SSL_CTX_load_verify_locations(_pSSLContext, Poco::Path::transcode(caLocation).c_str(), 0);
|
||||||
|
if (errCode != 1)
|
||||||
|
{
|
||||||
|
std::string msg = Utility::getLastError();
|
||||||
|
SSL_CTX_free(_pSSLContext);
|
||||||
|
throw SSLContextException(std::string("Cannot load CA file/directory at ") + caLocation, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loadDefaultCAs)
|
||||||
|
{
|
||||||
|
errCode = SSL_CTX_set_default_verify_paths(_pSSLContext);
|
||||||
|
if (errCode != 1)
|
||||||
|
{
|
||||||
|
std::string msg = Utility::getLastError();
|
||||||
|
SSL_CTX_free(_pSSLContext);
|
||||||
|
throw SSLContextException("Cannot load default CA certificates", msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (usage == SERVER_USE)
|
if (usage == SERVER_USE)
|
||||||
SSL_CTX_set_verify(_pSSLContext, verificationMode, &SSLManager::verifyServerCallback);
|
SSL_CTX_set_verify(_pSSLContext, verificationMode, &SSLManager::verifyServerCallback);
|
||||||
else
|
else
|
||||||
SSL_CTX_set_verify(_pSSLContext, verificationMode, &SSLManager::verifyClientCallback);
|
SSL_CTX_set_verify(_pSSLContext, verificationMode, &SSLManager::verifyClientCallback);
|
||||||
|
|
||||||
SSL_CTX_set_verify_depth(_pSSLContext, verificationDepth);
|
SSL_CTX_set_cipher_list(_pSSLContext, cipherList.c_str());
|
||||||
SSL_CTX_set_mode(_pSSLContext, SSL_MODE_AUTO_RETRY);
|
SSL_CTX_set_verify_depth(_pSSLContext, verificationDepth);
|
||||||
|
SSL_CTX_set_mode(_pSSLContext, SSL_MODE_AUTO_RETRY);
|
||||||
|
SSL_CTX_set_session_cache_mode(_pSSLContext, SSL_SESS_CACHE_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Context::~Context()
|
Context::~Context()
|
||||||
{
|
{
|
||||||
SSL_CTX_free(_pSSLContext);
|
SSL_CTX_free(_pSSLContext);
|
||||||
|
|
||||||
|
Poco::Crypto::OpenSSLInitializer::uninitialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Context::useCertificate(const Poco::Crypto::X509Certificate& certificate)
|
||||||
|
{
|
||||||
|
int errCode = SSL_CTX_use_certificate(_pSSLContext, const_cast<X509*>(certificate.certificate()));
|
||||||
|
if (errCode != 1)
|
||||||
|
{
|
||||||
|
std::string msg = Utility::getLastError();
|
||||||
|
throw SSLContextException("Cannot set certificate for Context", msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Context::addChainCertificate(const Poco::Crypto::X509Certificate& certificate)
|
||||||
|
{
|
||||||
|
int errCode = SSL_CTX_add_extra_chain_cert(_pSSLContext, certificate.certificate());
|
||||||
|
if (errCode != 1)
|
||||||
|
{
|
||||||
|
std::string msg = Utility::getLastError();
|
||||||
|
throw SSLContextException("Cannot add chain certificate to Context", msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Context::usePrivateKey(const Poco::Crypto::RSAKey& key)
|
||||||
|
{
|
||||||
|
int errCode = SSL_CTX_use_RSAPrivateKey(_pSSLContext, key.impl()->getRSA());
|
||||||
|
if (errCode != 1)
|
||||||
|
{
|
||||||
|
std::string msg = Utility::getLastError();
|
||||||
|
throw SSLContextException("Cannot set private key for Context", msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Context::enableSessionCache(bool flag)
|
||||||
|
{
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
|
SSL_CTX_set_session_cache_mode(_pSSLContext, _usage == SERVER_USE ? SSL_SESS_CACHE_SERVER : SSL_SESS_CACHE_CLIENT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SSL_CTX_set_session_cache_mode(_pSSLContext, SSL_SESS_CACHE_OFF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Context::enableSessionCache(bool flag, const std::string& sessionIdContext)
|
||||||
|
{
|
||||||
|
poco_assert (_usage == SERVER_USE);
|
||||||
|
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
|
SSL_CTX_set_session_cache_mode(_pSSLContext, SSL_SESS_CACHE_SERVER);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SSL_CTX_set_session_cache_mode(_pSSLContext, SSL_SESS_CACHE_OFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned length = static_cast<unsigned>(sessionIdContext.length());
|
||||||
|
if (length > SSL_MAX_SSL_SESSION_ID_LENGTH) length = SSL_MAX_SSL_SESSION_ID_LENGTH;
|
||||||
|
int rc = SSL_CTX_set_session_id_context(_pSSLContext, reinterpret_cast<const unsigned char*>(sessionIdContext.data()), length);
|
||||||
|
if (rc != 1) throw SSLContextException("cannot set session ID context");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Context::sessionCacheEnabled() const
|
||||||
|
{
|
||||||
|
return SSL_CTX_get_session_cache_mode(_pSSLContext) != SSL_SESS_CACHE_OFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Context::setSessionCacheSize(std::size_t size)
|
||||||
|
{
|
||||||
|
poco_assert (_usage == SERVER_USE);
|
||||||
|
|
||||||
|
SSL_CTX_sess_set_cache_size(_pSSLContext, static_cast<long>(size));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::size_t Context::getSessionCacheSize() const
|
||||||
|
{
|
||||||
|
poco_assert (_usage == SERVER_USE);
|
||||||
|
|
||||||
|
return static_cast<std::size_t>(SSL_CTX_sess_get_cache_size(_pSSLContext));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Context::setSessionTimeout(long seconds)
|
||||||
|
{
|
||||||
|
poco_assert (_usage == SERVER_USE);
|
||||||
|
|
||||||
|
SSL_CTX_set_timeout(_pSSLContext, seconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
long Context::getSessionTimeout() const
|
||||||
|
{
|
||||||
|
poco_assert (_usage == SERVER_USE);
|
||||||
|
|
||||||
|
return SSL_CTX_get_timeout(_pSSLContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Context::flushSessionCache()
|
||||||
|
{
|
||||||
|
poco_assert (_usage == SERVER_USE);
|
||||||
|
|
||||||
|
Poco::Timestamp now;
|
||||||
|
SSL_CTX_flush_sessions(_pSSLContext, static_cast<long>(now.epochTime()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Context::enableExtendedCertificateVerification(bool flag)
|
||||||
|
{
|
||||||
|
_extendedCertificateVerification = flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Context::disableStatelessSessionResumption()
|
||||||
|
{
|
||||||
|
#if defined(SSL_OP_NO_TICKET)
|
||||||
|
SSL_CTX_set_options(_pSSLContext, SSL_OP_NO_TICKET);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
// Package: HTTPSClient
|
// Package: HTTPSClient
|
||||||
// Module: HTTPSClientSession
|
// Module: HTTPSClientSession
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@@ -68,9 +68,18 @@ HTTPSClientSession::HTTPSClientSession(const SecureStreamSocket& socket):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HTTPSClientSession::HTTPSClientSession(const SecureStreamSocket& socket, Session::Ptr pSession):
|
||||||
|
HTTPClientSession(socket),
|
||||||
|
_pContext(socket.context()),
|
||||||
|
_pSession(pSession)
|
||||||
|
{
|
||||||
|
setPort(HTTPS_PORT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 port):
|
HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 port):
|
||||||
HTTPClientSession(SecureStreamSocket()),
|
HTTPClientSession(SecureStreamSocket()),
|
||||||
_pContext(SSLManager::instance().defaultClientContext())
|
_pContext(SSLManager::instance().defaultClientContext())
|
||||||
{
|
{
|
||||||
setHost(host);
|
setHost(host);
|
||||||
setPort(port);
|
setPort(port);
|
||||||
@@ -86,9 +95,17 @@ HTTPSClientSession::HTTPSClientSession(Context::Ptr pContext):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HTTPSClientSession::HTTPSClientSession(Context::Ptr pContext, Session::Ptr pSession):
|
||||||
|
HTTPClientSession(SecureStreamSocket(pContext, pSession)),
|
||||||
|
_pContext(pContext),
|
||||||
|
_pSession(pSession)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 port, Context::Ptr pContext):
|
HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 port, Context::Ptr pContext):
|
||||||
HTTPClientSession(SecureStreamSocket(pContext)),
|
HTTPClientSession(SecureStreamSocket(pContext)),
|
||||||
_pContext(pContext)
|
_pContext(pContext)
|
||||||
{
|
{
|
||||||
setHost(host);
|
setHost(host);
|
||||||
setPort(port);
|
setPort(port);
|
||||||
@@ -97,14 +114,39 @@ HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 por
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 port, Context::Ptr pContext, Session::Ptr pSession):
|
||||||
|
HTTPClientSession(SecureStreamSocket(pContext, pSession)),
|
||||||
|
_pContext(pContext),
|
||||||
|
_pSession(pSession)
|
||||||
|
{
|
||||||
|
setHost(host);
|
||||||
|
setPort(port);
|
||||||
|
SecureStreamSocket sss(socket());
|
||||||
|
sss.setPeerHostName(host);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HTTPSClientSession::~HTTPSClientSession()
|
HTTPSClientSession::~HTTPSClientSession()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool HTTPSClientSession::secure() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void HTTPSClientSession::abort()
|
||||||
|
{
|
||||||
|
SecureStreamSocket sss(socket());
|
||||||
|
sss.abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
X509Certificate HTTPSClientSession::serverCertificate()
|
X509Certificate HTTPSClientSession::serverCertificate()
|
||||||
{
|
{
|
||||||
SecureStreamSocket sss(socket());
|
SecureStreamSocket sss(socket());
|
||||||
return sss.peerCertificate();
|
return sss.peerCertificate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,32 +157,58 @@ std::string HTTPSClientSession::proxyRequestPrefix() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void HTTPSClientSession::proxyAuthenticate(HTTPRequest& request)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void HTTPSClientSession::connect(const SocketAddress& address)
|
void HTTPSClientSession::connect(const SocketAddress& address)
|
||||||
{
|
{
|
||||||
if (getProxyHost().empty())
|
if (getProxyHost().empty())
|
||||||
{
|
{
|
||||||
HTTPSession::connect(address);
|
SecureStreamSocket sss(socket());
|
||||||
}
|
if (_pContext->sessionCacheEnabled())
|
||||||
else
|
{
|
||||||
{
|
sss.useSession(_pSession);
|
||||||
HTTPClientSession proxySession(address);
|
}
|
||||||
proxySession.setHost(getProxyHost());
|
HTTPSession::connect(address);
|
||||||
proxySession.setPort(getProxyPort());
|
if (_pContext->sessionCacheEnabled())
|
||||||
SocketAddress targetAddress(getHost(), getPort());
|
{
|
||||||
HTTPRequest proxyRequest(HTTPRequest::HTTP_CONNECT, targetAddress.toString(), HTTPMessage::HTTP_1_1);
|
_pSession = sss.currentSession();
|
||||||
HTTPResponse proxyResponse;
|
}
|
||||||
proxyRequest.set("Proxy-Connection", "keep-alive");
|
}
|
||||||
proxyRequest.set("Host", getHost());
|
else
|
||||||
proxySession.setKeepAlive(true);
|
{
|
||||||
proxySession.sendRequest(proxyRequest);
|
HTTPClientSession proxySession(address);
|
||||||
proxySession.receiveResponse(proxyResponse);
|
proxySession.setHost(getProxyHost());
|
||||||
|
proxySession.setPort(getProxyPort());
|
||||||
|
proxySession.setTimeout(getTimeout());
|
||||||
|
SocketAddress targetAddress(getHost(), getPort());
|
||||||
|
HTTPRequest proxyRequest(HTTPRequest::HTTP_CONNECT, targetAddress.toString(), HTTPMessage::HTTP_1_1);
|
||||||
|
HTTPResponse proxyResponse;
|
||||||
|
proxyRequest.set("Proxy-Connection", "keep-alive");
|
||||||
|
proxyRequest.set("Host", getHost());
|
||||||
|
proxyAuthenticateImpl(proxyRequest);
|
||||||
|
proxySession.setKeepAlive(true);
|
||||||
|
proxySession.sendRequest(proxyRequest);
|
||||||
|
proxySession.receiveResponse(proxyResponse);
|
||||||
if (proxyResponse.getStatus() != HTTPResponse::HTTP_OK)
|
if (proxyResponse.getStatus() != HTTPResponse::HTTP_OK)
|
||||||
throw HTTPException("Cannot establish proxy connection", proxyResponse.getReason());
|
throw HTTPException("Cannot establish proxy connection", proxyResponse.getReason());
|
||||||
|
|
||||||
StreamSocket proxySocket(proxySession.detachSocket());
|
StreamSocket proxySocket(proxySession.detachSocket());
|
||||||
SecureStreamSocket secureSocket = SecureStreamSocket::attach(proxySocket, getHost(), _pContext);
|
SecureStreamSocket secureSocket = SecureStreamSocket::attach(proxySocket, getHost(), _pContext, _pSession);
|
||||||
attachSocket(secureSocket);
|
attachSocket(secureSocket);
|
||||||
}
|
if (_pContext->sessionCacheEnabled())
|
||||||
|
{
|
||||||
|
_pSession = secureSocket.currentSession();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Session::Ptr HTTPSClientSession::sslSession()
|
||||||
|
{
|
||||||
|
return _pSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -55,10 +55,11 @@ HTTPSSessionInstantiator::~HTTPSSessionInstantiator()
|
|||||||
|
|
||||||
HTTPClientSession* HTTPSSessionInstantiator::createClientSession(const Poco::URI& uri)
|
HTTPClientSession* HTTPSSessionInstantiator::createClientSession(const Poco::URI& uri)
|
||||||
{
|
{
|
||||||
poco_assert (uri.getScheme() == "https");
|
poco_assert (uri.getScheme() == "https");
|
||||||
HTTPSClientSession* pSession = new HTTPSClientSession(uri.getHost(), uri.getPort());
|
HTTPSClientSession* pSession = new HTTPSClientSession(uri.getHost(), uri.getPort());
|
||||||
pSession->setProxy(proxyHost(), proxyPort());
|
pSession->setProxy(proxyHost(), proxyPort());
|
||||||
return pSession;
|
pSession->setProxyCredentials(proxyUsername(), proxyPassword());
|
||||||
|
return pSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -68,6 +68,15 @@ HTTPSStreamFactory::HTTPSStreamFactory(const std::string& proxyHost, Poco::UInt1
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HTTPSStreamFactory::HTTPSStreamFactory(const std::string& proxyHost, Poco::UInt16 proxyPort, const std::string& proxyUsername, const std::string& proxyPassword):
|
||||||
|
_proxyHost(proxyHost),
|
||||||
|
_proxyPort(proxyPort),
|
||||||
|
_proxyUsername(proxyUsername),
|
||||||
|
_proxyPassword(proxyPassword)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HTTPSStreamFactory::~HTTPSStreamFactory()
|
HTTPSStreamFactory::~HTTPSStreamFactory()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -91,12 +100,13 @@ std::istream* HTTPSStreamFactory::open(const URI& uri)
|
|||||||
else
|
else
|
||||||
pSession = new HTTPClientSession(resolvedURI.getHost(), resolvedURI.getPort());
|
pSession = new HTTPClientSession(resolvedURI.getHost(), resolvedURI.getPort());
|
||||||
if (proxyUri.empty())
|
if (proxyUri.empty())
|
||||||
pSession->setProxy(_proxyHost, _proxyPort);
|
pSession->setProxy(_proxyHost, _proxyPort);
|
||||||
else
|
else
|
||||||
pSession->setProxy(proxyUri.getHost(), proxyUri.getPort());
|
pSession->setProxy(proxyUri.getHost(), proxyUri.getPort());
|
||||||
std::string path = resolvedURI.getPathAndQuery();
|
pSession->setProxyCredentials(_proxyUsername, _proxyPassword);
|
||||||
if (path.empty()) path = "/";
|
std::string path = resolvedURI.getPathAndQuery();
|
||||||
HTTPRequest req(HTTPRequest::HTTP_GET, path, HTTPMessage::HTTP_1_1);
|
if (path.empty()) path = "/";
|
||||||
|
HTTPRequest req(HTTPRequest::HTTP_GET, path, HTTPMessage::HTTP_1_1);
|
||||||
pSession->sendRequest(req);
|
pSession->sendRequest(req);
|
||||||
HTTPResponse res;
|
HTTPResponse res;
|
||||||
std::istream& rs = pSession->receiveResponse(res);
|
std::istream& rs = pSession->receiveResponse(res);
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
#include "Poco/Net/KeyFileHandler.h"
|
#include "Poco/Net/KeyFileHandler.h"
|
||||||
#include "Poco/Net/SSLManager.h"
|
#include "Poco/Net/SSLManager.h"
|
||||||
#include "Poco/File.h"
|
#include "Poco/File.h"
|
||||||
#include "Poco/Util/LayeredConfiguration.h"
|
#include "Poco/Util/AbstractConfiguration.h"
|
||||||
#include "Poco/Util/Application.h"
|
#include "Poco/Util/Application.h"
|
||||||
#include "Poco/Util/OptionException.h"
|
#include "Poco/Util/OptionException.h"
|
||||||
|
|
||||||
@@ -61,14 +61,22 @@ KeyFileHandler::~KeyFileHandler()
|
|||||||
|
|
||||||
void KeyFileHandler::onPrivateKeyRequested(const void* pSender, std::string& privateKey)
|
void KeyFileHandler::onPrivateKeyRequested(const void* pSender, std::string& privateKey)
|
||||||
{
|
{
|
||||||
Poco::Util::LayeredConfiguration& config = Poco::Util::Application::instance().config();
|
try
|
||||||
std::string prefix = serverSide() ? SSLManager::CFG_SERVER_PREFIX : SSLManager::CFG_CLIENT_PREFIX;
|
{
|
||||||
if (!config.hasProperty(prefix + CFG_PRIV_KEY_FILE))
|
Poco::Util::AbstractConfiguration& config = Poco::Util::Application::instance().config();
|
||||||
{
|
std::string prefix = serverSide() ? SSLManager::CFG_SERVER_PREFIX : SSLManager::CFG_CLIENT_PREFIX;
|
||||||
throw Poco::Util::EmptyOptionException(std::string("Missing Configuration Entry: ") + prefix + CFG_PRIV_KEY_FILE);
|
if (!config.hasProperty(prefix + CFG_PRIV_KEY_FILE))
|
||||||
}
|
throw Poco::Util::EmptyOptionException(std::string("Missing Configuration Entry: ") + prefix + CFG_PRIV_KEY_FILE);
|
||||||
|
|
||||||
privateKey = config.getString(prefix + CFG_PRIV_KEY_FILE);
|
privateKey = config.getString(prefix + CFG_PRIV_KEY_FILE);
|
||||||
|
}
|
||||||
|
catch (Poco::NullPointerException&)
|
||||||
|
{
|
||||||
|
throw Poco::IllegalStateException(
|
||||||
|
"An application configuration is required to obtain the private key passphrase, "
|
||||||
|
"but no Poco::Util::Application instance is available."
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -48,13 +48,13 @@ namespace Net {
|
|||||||
|
|
||||||
PrivateKeyPassphraseHandler::PrivateKeyPassphraseHandler(bool onServerSide): _serverSide(onServerSide)
|
PrivateKeyPassphraseHandler::PrivateKeyPassphraseHandler(bool onServerSide): _serverSide(onServerSide)
|
||||||
{
|
{
|
||||||
SSLManager::instance().PrivateKeyPassPhrase += Delegate<PrivateKeyPassphraseHandler, std::string>(this, &PrivateKeyPassphraseHandler::onPrivateKeyRequested);
|
SSLManager::instance().PrivateKeyPassphraseRequired += Delegate<PrivateKeyPassphraseHandler, std::string>(this, &PrivateKeyPassphraseHandler::onPrivateKeyRequested);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PrivateKeyPassphraseHandler::~PrivateKeyPassphraseHandler()
|
PrivateKeyPassphraseHandler::~PrivateKeyPassphraseHandler()
|
||||||
{
|
{
|
||||||
SSLManager::instance().PrivateKeyPassPhrase -= Delegate<PrivateKeyPassphraseHandler, std::string>(this, &PrivateKeyPassphraseHandler::onPrivateKeyRequested);
|
SSLManager::instance().PrivateKeyPassphraseRequired -= Delegate<PrivateKeyPassphraseHandler, std::string>(this, &PrivateKeyPassphraseHandler::onPrivateKeyRequested);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
60
NetSSL_OpenSSL/src/RejectCertificateHandler.cpp
Normal file
60
NetSSL_OpenSSL/src/RejectCertificateHandler.cpp
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
//
|
||||||
|
// RejectCertificateHandler.cpp
|
||||||
|
//
|
||||||
|
// $Id: //poco/1.4/NetSSL_OpenSSL/src/RejectCertificateHandler.cpp#1 $
|
||||||
|
//
|
||||||
|
// Library: NetSSL_OpenSSL
|
||||||
|
// Package: SSLCore
|
||||||
|
// Module: RejectCertificateHandler
|
||||||
|
//
|
||||||
|
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
||||||
|
// and Contributors.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
|
// obtaining a copy of the software and accompanying documentation covered by
|
||||||
|
// this license (the "Software") to use, reproduce, display, distribute,
|
||||||
|
// execute, and transmit the Software, and to prepare derivative works of the
|
||||||
|
// Software, and to permit third-parties to whom the Software is furnished to
|
||||||
|
// do so, all subject to the following:
|
||||||
|
//
|
||||||
|
// The copyright notices in the Software and this entire statement, including
|
||||||
|
// the above license grant, this restriction and the following disclaimer,
|
||||||
|
// must be included in all copies of the Software, in whole or in part, and
|
||||||
|
// all derivative works of the Software, unless such copies or derivative
|
||||||
|
// works are solely in the form of machine-executable object code generated by
|
||||||
|
// a source language processor.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||||
|
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||||
|
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||||
|
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#include "Poco/Net/RejectCertificateHandler.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Poco {
|
||||||
|
namespace Net {
|
||||||
|
|
||||||
|
|
||||||
|
RejectCertificateHandler::RejectCertificateHandler(bool server): InvalidCertificateHandler(server)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RejectCertificateHandler::~RejectCertificateHandler()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RejectCertificateHandler::onInvalidCertificate(const void*, VerificationErrorArgs& errorCert)
|
||||||
|
{
|
||||||
|
errorCert.setIgnoreError(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} } // namespace Poco::Net
|
@@ -46,6 +46,7 @@ POCO_IMPLEMENT_EXCEPTION(SSLException, NetException, "SSL Exception")
|
|||||||
POCO_IMPLEMENT_EXCEPTION(SSLContextException, SSLException, "SSL context exception")
|
POCO_IMPLEMENT_EXCEPTION(SSLContextException, SSLException, "SSL context exception")
|
||||||
POCO_IMPLEMENT_EXCEPTION(InvalidCertificateException, SSLException, "Invalid certficate")
|
POCO_IMPLEMENT_EXCEPTION(InvalidCertificateException, SSLException, "Invalid certficate")
|
||||||
POCO_IMPLEMENT_EXCEPTION(CertificateValidationException, SSLException, "Certificate validation error")
|
POCO_IMPLEMENT_EXCEPTION(CertificateValidationException, SSLException, "Certificate validation error")
|
||||||
|
POCO_IMPLEMENT_EXCEPTION(SSLConnectionUnexpectedlyClosedException, SSLException, "SSL connection unexpectedly closed")
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
// Package: SSLCore
|
// Package: SSLCore
|
||||||
// Module: SSLManager
|
// Module: SSLManager
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@@ -44,7 +44,6 @@
|
|||||||
#include "Poco/Delegate.h"
|
#include "Poco/Delegate.h"
|
||||||
#include "Poco/Util/Application.h"
|
#include "Poco/Util/Application.h"
|
||||||
#include "Poco/Util/OptionException.h"
|
#include "Poco/Util/OptionException.h"
|
||||||
#include "Poco/Util/LayeredConfiguration.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
@@ -60,60 +59,81 @@ const std::string SSLManager::CFG_VER_DEPTH("verificationDepth");
|
|||||||
const int SSLManager::VAL_VER_DEPTH(9);
|
const int SSLManager::VAL_VER_DEPTH(9);
|
||||||
const std::string SSLManager::CFG_ENABLE_DEFAULT_CA("loadDefaultCAFile");
|
const std::string SSLManager::CFG_ENABLE_DEFAULT_CA("loadDefaultCAFile");
|
||||||
const bool SSLManager::VAL_ENABLE_DEFAULT_CA(false);
|
const bool SSLManager::VAL_ENABLE_DEFAULT_CA(false);
|
||||||
|
const std::string SSLManager::CFG_CIPHER_LIST("cipherList");
|
||||||
const std::string SSLManager::CFG_CYPHER_LIST("cypherList");
|
const std::string SSLManager::CFG_CYPHER_LIST("cypherList");
|
||||||
const std::string SSLManager::VAL_CYPHER_LIST("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
const std::string SSLManager::VAL_CIPHER_LIST("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
||||||
const std::string SSLManager::CFG_DELEGATE_HANDLER("privateKeyPassphraseHandler.name");
|
const std::string SSLManager::CFG_DELEGATE_HANDLER("privateKeyPassphraseHandler.name");
|
||||||
const std::string SSLManager::VAL_DELEGATE_HANDLER("KeyConsoleHandler");
|
const std::string SSLManager::VAL_DELEGATE_HANDLER("KeyConsoleHandler");
|
||||||
const std::string SSLManager::CFG_CERTIFICATE_HANDLER("invalidCertificateHandler.name");
|
const std::string SSLManager::CFG_CERTIFICATE_HANDLER("invalidCertificateHandler.name");
|
||||||
const std::string SSLManager::VAL_CERTIFICATE_HANDLER("ConsoleCertificateHandler");
|
const std::string SSLManager::VAL_CERTIFICATE_HANDLER("ConsoleCertificateHandler");
|
||||||
const std::string SSLManager::CFG_SERVER_PREFIX("openSSL.server.");
|
const std::string SSLManager::CFG_SERVER_PREFIX("openSSL.server.");
|
||||||
const std::string SSLManager::CFG_CLIENT_PREFIX("openSSL.client.");
|
const std::string SSLManager::CFG_CLIENT_PREFIX("openSSL.client.");
|
||||||
|
const std::string SSLManager::CFG_CACHE_SESSIONS("cacheSessions");
|
||||||
|
const std::string SSLManager::CFG_SESSION_ID_CONTEXT("sessionIdContext");
|
||||||
|
const std::string SSLManager::CFG_SESSION_CACHE_SIZE("sessionCacheSize");
|
||||||
|
const std::string SSLManager::CFG_SESSION_TIMEOUT("sessionTimeout");
|
||||||
|
const std::string SSLManager::CFG_EXTENDED_VERIFICATION("extendedVerification");
|
||||||
|
#ifdef OPENSSL_FIPS
|
||||||
|
const std::string SSLManager::CFG_FIPS_MODE("openSSL.fips");
|
||||||
|
const bool SSLManager::VAL_FIPS_MODE(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
SSLManager::SSLManager()
|
SSLManager::SSLManager()
|
||||||
{
|
{
|
||||||
Poco::Crypto::OpenSSLInitializer::initialize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SSLManager::~SSLManager()
|
SSLManager::~SSLManager()
|
||||||
{
|
{
|
||||||
PrivateKeyPassPhrase.clear();
|
shutdown();
|
||||||
ClientVerificationError.clear();
|
}
|
||||||
ServerVerificationError.clear();
|
|
||||||
_ptrDefaultServerContext = 0; // ensure all Context objects go away before we uninitialize OpenSSL.
|
|
||||||
_ptrDefaultClientContext = 0;
|
void SSLManager::shutdown()
|
||||||
Poco::Crypto::OpenSSLInitializer::uninitialize();
|
{
|
||||||
|
PrivateKeyPassphraseRequired.clear();
|
||||||
|
ClientVerificationError.clear();
|
||||||
|
ServerVerificationError.clear();
|
||||||
|
_ptrDefaultServerContext = 0;
|
||||||
|
_ptrDefaultClientContext = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
static Poco::SingletonHolder<SSLManager> singleton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SSLManager& SSLManager::instance()
|
SSLManager& SSLManager::instance()
|
||||||
{
|
{
|
||||||
static Poco::SingletonHolder<SSLManager> singleton;
|
return *singleton.get();
|
||||||
return *singleton.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SSLManager::initializeServer(PrivateKeyPassphraseHandlerPtr ptrPassPhraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext)
|
void SSLManager::initializeServer(PrivateKeyPassphraseHandlerPtr ptrPassphraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext)
|
||||||
{
|
{
|
||||||
_ptrServerPassPhraseHandler = ptrPassPhraseHandler;
|
_ptrServerPassphraseHandler = ptrPassphraseHandler;
|
||||||
_ptrServerCertificateHandler = ptrHandler;
|
_ptrServerCertificateHandler = ptrHandler;
|
||||||
_ptrDefaultServerContext = ptrContext;
|
_ptrDefaultServerContext = ptrContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SSLManager::initializeClient(PrivateKeyPassphraseHandlerPtr ptrPassPhraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext)
|
void SSLManager::initializeClient(PrivateKeyPassphraseHandlerPtr ptrPassphraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext)
|
||||||
{
|
{
|
||||||
_ptrClientPassPhraseHandler = ptrPassPhraseHandler;
|
_ptrClientPassphraseHandler = ptrPassphraseHandler;
|
||||||
_ptrClientCertificateHandler = ptrHandler;
|
_ptrClientCertificateHandler = ptrHandler;
|
||||||
_ptrDefaultClientContext = ptrContext;
|
_ptrDefaultClientContext = ptrContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Context::Ptr SSLManager::defaultServerContext()
|
Context::Ptr SSLManager::defaultServerContext()
|
||||||
{
|
{
|
||||||
if (!_ptrDefaultServerContext)
|
Poco::FastMutex::ScopedLock lock(_mutex);
|
||||||
initDefaultContext(true);
|
|
||||||
|
if (!_ptrDefaultServerContext)
|
||||||
|
initDefaultContext(true);
|
||||||
|
|
||||||
return _ptrDefaultServerContext;
|
return _ptrDefaultServerContext;
|
||||||
}
|
}
|
||||||
@@ -121,35 +141,43 @@ Context::Ptr SSLManager::defaultServerContext()
|
|||||||
|
|
||||||
Context::Ptr SSLManager::defaultClientContext()
|
Context::Ptr SSLManager::defaultClientContext()
|
||||||
{
|
{
|
||||||
if (!_ptrDefaultClientContext)
|
Poco::FastMutex::ScopedLock lock(_mutex);
|
||||||
initDefaultContext(false);
|
|
||||||
|
if (!_ptrDefaultClientContext)
|
||||||
|
initDefaultContext(false);
|
||||||
|
|
||||||
return _ptrDefaultClientContext;
|
return _ptrDefaultClientContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SSLManager::PrivateKeyPassphraseHandlerPtr SSLManager::serverPassPhraseHandler()
|
SSLManager::PrivateKeyPassphraseHandlerPtr SSLManager::serverPassphraseHandler()
|
||||||
{
|
{
|
||||||
if (!_ptrServerPassPhraseHandler)
|
Poco::FastMutex::ScopedLock lock(_mutex);
|
||||||
initPassPhraseHandler(true);
|
|
||||||
|
|
||||||
return _ptrServerPassPhraseHandler;
|
if (!_ptrServerPassphraseHandler)
|
||||||
|
initPassphraseHandler(true);
|
||||||
|
|
||||||
|
return _ptrServerPassphraseHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SSLManager::PrivateKeyPassphraseHandlerPtr SSLManager::clientPassPhraseHandler()
|
SSLManager::PrivateKeyPassphraseHandlerPtr SSLManager::clientPassphraseHandler()
|
||||||
{
|
{
|
||||||
if (!_ptrClientPassPhraseHandler)
|
Poco::FastMutex::ScopedLock lock(_mutex);
|
||||||
initPassPhraseHandler(false);
|
|
||||||
|
|
||||||
return _ptrClientPassPhraseHandler;
|
if (!_ptrClientPassphraseHandler)
|
||||||
|
initPassphraseHandler(false);
|
||||||
|
|
||||||
|
return _ptrClientPassphraseHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SSLManager::InvalidCertificateHandlerPtr SSLManager::serverCertificateHandler()
|
SSLManager::InvalidCertificateHandlerPtr SSLManager::serverCertificateHandler()
|
||||||
{
|
{
|
||||||
if (!_ptrServerCertificateHandler)
|
Poco::FastMutex::ScopedLock lock(_mutex);
|
||||||
initCertificateHandler(true);
|
|
||||||
|
if (!_ptrServerCertificateHandler)
|
||||||
|
initCertificateHandler(true);
|
||||||
|
|
||||||
return _ptrServerCertificateHandler;
|
return _ptrServerCertificateHandler;
|
||||||
}
|
}
|
||||||
@@ -157,8 +185,10 @@ SSLManager::InvalidCertificateHandlerPtr SSLManager::serverCertificateHandler()
|
|||||||
|
|
||||||
SSLManager::InvalidCertificateHandlerPtr SSLManager::clientCertificateHandler()
|
SSLManager::InvalidCertificateHandlerPtr SSLManager::clientCertificateHandler()
|
||||||
{
|
{
|
||||||
if (!_ptrClientCertificateHandler)
|
Poco::FastMutex::ScopedLock lock(_mutex);
|
||||||
initCertificateHandler(false);
|
|
||||||
|
if (!_ptrClientCertificateHandler)
|
||||||
|
initCertificateHandler(false);
|
||||||
|
|
||||||
return _ptrClientCertificateHandler;
|
return _ptrClientCertificateHandler;
|
||||||
}
|
}
|
||||||
@@ -166,13 +196,13 @@ SSLManager::InvalidCertificateHandlerPtr SSLManager::clientCertificateHandler()
|
|||||||
|
|
||||||
int SSLManager::verifyCallback(bool server, int ok, X509_STORE_CTX* pStore)
|
int SSLManager::verifyCallback(bool server, int ok, X509_STORE_CTX* pStore)
|
||||||
{
|
{
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
X509* pCert = X509_STORE_CTX_get_current_cert(pStore);
|
X509* pCert = X509_STORE_CTX_get_current_cert(pStore);
|
||||||
X509Certificate x509(pCert);
|
X509Certificate x509(pCert, true);
|
||||||
int depth = X509_STORE_CTX_get_error_depth(pStore);
|
int depth = X509_STORE_CTX_get_error_depth(pStore);
|
||||||
int err = X509_STORE_CTX_get_error(pStore);
|
int err = X509_STORE_CTX_get_error(pStore);
|
||||||
std::string error(X509_verify_cert_error_string(err));
|
std::string error(X509_verify_cert_error_string(err));
|
||||||
VerificationErrorArgs args(x509, depth, err, error);
|
VerificationErrorArgs args(x509, depth, err, error);
|
||||||
if (server)
|
if (server)
|
||||||
SSLManager::instance().ServerVerificationError.notify(&SSLManager::instance(), args);
|
SSLManager::instance().ServerVerificationError.notify(&SSLManager::instance(), args);
|
||||||
@@ -185,13 +215,13 @@ int SSLManager::verifyCallback(bool server, int ok, X509_STORE_CTX* pStore)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SSLManager::privateKeyPasswdCallback(char* pBuf, int size, int flag, void* userData)
|
int SSLManager::privateKeyPassphraseCallback(char* pBuf, int size, int flag, void* userData)
|
||||||
{
|
{
|
||||||
std::string pwd;
|
std::string pwd;
|
||||||
SSLManager::instance().PrivateKeyPassPhrase.notify(&SSLManager::instance(), pwd);
|
SSLManager::instance().PrivateKeyPassphraseRequired.notify(&SSLManager::instance(), pwd);
|
||||||
|
|
||||||
strncpy(pBuf, (char *)(pwd.c_str()), size);
|
strncpy(pBuf, (char *)(pwd.c_str()), size);
|
||||||
pBuf[size - 1] = '\0';
|
pBuf[size - 1] = '\0';
|
||||||
if (size > pwd.length())
|
if (size > pwd.length())
|
||||||
size = (int) pwd.length();
|
size = (int) pwd.length();
|
||||||
|
|
||||||
@@ -201,24 +231,33 @@ int SSLManager::privateKeyPasswdCallback(char* pBuf, int size, int flag, void* u
|
|||||||
|
|
||||||
void SSLManager::initDefaultContext(bool server)
|
void SSLManager::initDefaultContext(bool server)
|
||||||
{
|
{
|
||||||
if (server && _ptrDefaultServerContext) return;
|
if (server && _ptrDefaultServerContext) return;
|
||||||
if (!server && _ptrDefaultClientContext) return;
|
if (!server && _ptrDefaultClientContext) return;
|
||||||
|
|
||||||
initEvents(server);
|
Poco::Crypto::OpenSSLInitializer openSSLInitializer;
|
||||||
|
initEvents(server);
|
||||||
|
Poco::Util::AbstractConfiguration& config = appConfig();
|
||||||
|
|
||||||
Poco::Util::LayeredConfiguration& config = Poco::Util::Application::instance().config();
|
#ifdef OPENSSL_FIPS
|
||||||
std::string prefix = server ? CFG_SERVER_PREFIX : CFG_CLIENT_PREFIX;
|
bool fipsEnabled = config.getBool(CFG_FIPS_MODE, VAL_FIPS_MODE);
|
||||||
|
if (fipsEnabled && !Poco::Crypto::OpenSSLInitializer::isFIPSEnabled())
|
||||||
|
{
|
||||||
|
Poco::Crypto::OpenSSLInitializer::enableFIPSMode(true);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// mandatory options
|
std::string prefix = server ? CFG_SERVER_PREFIX : CFG_CLIENT_PREFIX;
|
||||||
|
|
||||||
|
// mandatory options
|
||||||
std::string privKeyFile = config.getString(prefix + CFG_PRIV_KEY_FILE, "");
|
std::string privKeyFile = config.getString(prefix + CFG_PRIV_KEY_FILE, "");
|
||||||
std::string certFile = config.getString(prefix + CFG_CERTIFICATE_FILE, privKeyFile);
|
std::string certFile = config.getString(prefix + CFG_CERTIFICATE_FILE, privKeyFile);
|
||||||
std::string caLocation = config.getString(prefix + CFG_CA_LOCATION, "");
|
std::string caLocation = config.getString(prefix + CFG_CA_LOCATION, "");
|
||||||
|
|
||||||
if (certFile.empty() && privKeyFile.empty())
|
if (server && certFile.empty() && privKeyFile.empty())
|
||||||
throw SSLException("Configuration error: no certificate file has been specified.");
|
throw SSLException("Configuration error: no certificate file has been specified");
|
||||||
|
|
||||||
// optional options for which we have defaults defined
|
// optional options for which we have defaults defined
|
||||||
Context::VerificationMode verMode = VAL_VER_MODE;
|
Context::VerificationMode verMode = VAL_VER_MODE;
|
||||||
if (config.hasProperty(prefix + CFG_VER_MODE))
|
if (config.hasProperty(prefix + CFG_VER_MODE))
|
||||||
{
|
{
|
||||||
// either: none, relaxed, strict, once
|
// either: none, relaxed, strict, once
|
||||||
@@ -226,32 +265,59 @@ void SSLManager::initDefaultContext(bool server)
|
|||||||
verMode = Utility::convertVerificationMode(mode);
|
verMode = Utility::convertVerificationMode(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
int verDepth = config.getInt(prefix + CFG_VER_DEPTH, VAL_VER_DEPTH);
|
int verDepth = config.getInt(prefix + CFG_VER_DEPTH, VAL_VER_DEPTH);
|
||||||
bool loadDefCA = config.getBool(prefix + CFG_ENABLE_DEFAULT_CA, VAL_ENABLE_DEFAULT_CA);
|
bool loadDefCA = config.getBool(prefix + CFG_ENABLE_DEFAULT_CA, VAL_ENABLE_DEFAULT_CA);
|
||||||
std::string cypherList = config.getString(prefix + CFG_CYPHER_LIST, VAL_CYPHER_LIST);
|
std::string cipherList = config.getString(prefix + CFG_CIPHER_LIST, VAL_CIPHER_LIST);
|
||||||
if (server)
|
cipherList = config.getString(prefix + CFG_CYPHER_LIST, cipherList); // for backwards compatibility
|
||||||
_ptrDefaultServerContext = new Context(Context::SERVER_USE, privKeyFile, certFile, caLocation, verMode, verDepth, loadDefCA, cypherList);
|
if (server)
|
||||||
else
|
_ptrDefaultServerContext = new Context(Context::SERVER_USE, privKeyFile, certFile, caLocation, verMode, verDepth, loadDefCA, cipherList);
|
||||||
_ptrDefaultClientContext = new Context(Context::CLIENT_USE, privKeyFile, certFile, caLocation, verMode, verDepth, loadDefCA, cypherList);
|
else
|
||||||
|
_ptrDefaultClientContext = new Context(Context::CLIENT_USE, privKeyFile, certFile, caLocation, verMode, verDepth, loadDefCA, cipherList);
|
||||||
|
|
||||||
|
bool cacheSessions = config.getBool(prefix + CFG_CACHE_SESSIONS, false);
|
||||||
|
if (server)
|
||||||
|
{
|
||||||
|
std::string sessionIdContext = config.getString(prefix + CFG_SESSION_ID_CONTEXT, config.getString("application.name", ""));
|
||||||
|
_ptrDefaultServerContext->enableSessionCache(cacheSessions, sessionIdContext);
|
||||||
|
if (config.hasProperty(prefix + CFG_SESSION_CACHE_SIZE))
|
||||||
|
{
|
||||||
|
int cacheSize = config.getInt(prefix + CFG_SESSION_CACHE_SIZE);
|
||||||
|
_ptrDefaultServerContext->setSessionCacheSize(cacheSize);
|
||||||
|
}
|
||||||
|
if (config.hasProperty(prefix + CFG_SESSION_TIMEOUT))
|
||||||
|
{
|
||||||
|
int timeout = config.getInt(prefix + CFG_SESSION_TIMEOUT);
|
||||||
|
_ptrDefaultServerContext->setSessionTimeout(timeout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_ptrDefaultClientContext->enableSessionCache(cacheSessions);
|
||||||
|
}
|
||||||
|
bool extendedVerification = config.getBool(prefix + CFG_EXTENDED_VERIFICATION, false);
|
||||||
|
if (server)
|
||||||
|
_ptrDefaultServerContext->enableExtendedCertificateVerification(extendedVerification);
|
||||||
|
else
|
||||||
|
_ptrDefaultClientContext->enableExtendedCertificateVerification(extendedVerification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SSLManager::initEvents(bool server)
|
void SSLManager::initEvents(bool server)
|
||||||
{
|
{
|
||||||
initPassPhraseHandler(server);
|
initPassphraseHandler(server);
|
||||||
initCertificateHandler(server);
|
initCertificateHandler(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SSLManager::initPassPhraseHandler(bool server)
|
void SSLManager::initPassphraseHandler(bool server)
|
||||||
{
|
{
|
||||||
if (server && _ptrServerPassPhraseHandler) return;
|
if (server && _ptrServerPassphraseHandler) return;
|
||||||
if (!server && _ptrClientPassPhraseHandler) return;
|
if (!server && _ptrClientPassphraseHandler) return;
|
||||||
|
|
||||||
std::string prefix = server ? CFG_SERVER_PREFIX : CFG_CLIENT_PREFIX;
|
std::string prefix = server ? CFG_SERVER_PREFIX : CFG_CLIENT_PREFIX;
|
||||||
Poco::Util::LayeredConfiguration& config = Poco::Util::Application::instance().config();
|
Poco::Util::AbstractConfiguration& config = appConfig();
|
||||||
|
|
||||||
std::string className(config.getString(prefix + CFG_DELEGATE_HANDLER, VAL_DELEGATE_HANDLER));
|
std::string className(config.getString(prefix + CFG_DELEGATE_HANDLER, VAL_DELEGATE_HANDLER));
|
||||||
|
|
||||||
const PrivateKeyFactory* pFactory = 0;
|
const PrivateKeyFactory* pFactory = 0;
|
||||||
if (privateKeyFactoryMgr().hasFactory(className))
|
if (privateKeyFactoryMgr().hasFactory(className))
|
||||||
@@ -259,26 +325,26 @@ void SSLManager::initPassPhraseHandler(bool server)
|
|||||||
pFactory = privateKeyFactoryMgr().getFactory(className);
|
pFactory = privateKeyFactoryMgr().getFactory(className);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pFactory)
|
if (pFactory)
|
||||||
{
|
{
|
||||||
if (server)
|
if (server)
|
||||||
_ptrServerPassPhraseHandler = pFactory->create(server);
|
_ptrServerPassphraseHandler = pFactory->create(server);
|
||||||
else
|
else
|
||||||
_ptrClientPassPhraseHandler = pFactory->create(server);
|
_ptrClientPassphraseHandler = pFactory->create(server);
|
||||||
}
|
}
|
||||||
else throw Poco::Util::UnknownOptionException(std::string("No PassPhrasehandler known with the name ") + className);
|
else throw Poco::Util::UnknownOptionException(std::string("No passphrase handler known with the name ") + className);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SSLManager::initCertificateHandler(bool server)
|
void SSLManager::initCertificateHandler(bool server)
|
||||||
{
|
{
|
||||||
if (server && _ptrServerCertificateHandler) return;
|
if (server && _ptrServerCertificateHandler) return;
|
||||||
if (!server && _ptrClientCertificateHandler) return;
|
if (!server && _ptrClientCertificateHandler) return;
|
||||||
|
|
||||||
std::string prefix = server ? CFG_SERVER_PREFIX : CFG_CLIENT_PREFIX;
|
std::string prefix = server ? CFG_SERVER_PREFIX : CFG_CLIENT_PREFIX;
|
||||||
Poco::Util::LayeredConfiguration& config = Poco::Util::Application::instance().config();
|
Poco::Util::AbstractConfiguration& config = appConfig();
|
||||||
|
|
||||||
std::string className(config.getString(prefix+CFG_CERTIFICATE_HANDLER, VAL_CERTIFICATE_HANDLER));
|
std::string className(config.getString(prefix+CFG_CERTIFICATE_HANDLER, VAL_CERTIFICATE_HANDLER));
|
||||||
|
|
||||||
const CertificateHandlerFactory* pFactory = 0;
|
const CertificateHandlerFactory* pFactory = 0;
|
||||||
if (certificateHandlerFactoryMgr().hasFactory(className))
|
if (certificateHandlerFactoryMgr().hasFactory(className))
|
||||||
@@ -297,4 +363,33 @@ void SSLManager::initCertificateHandler(bool server)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Poco::Util::AbstractConfiguration& SSLManager::appConfig()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Poco::Util::Application::instance().config();
|
||||||
|
}
|
||||||
|
catch (Poco::NullPointerException&)
|
||||||
|
{
|
||||||
|
throw Poco::IllegalStateException(
|
||||||
|
"An application configuration is required to initialize the Poco::Net::SSLManager, "
|
||||||
|
"but no Poco::Util::Application instance is available."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void initializeSSL()
|
||||||
|
{
|
||||||
|
Poco::Crypto::initializeCrypto();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void uninitializeSSL()
|
||||||
|
{
|
||||||
|
SSLManager::instance().shutdown();
|
||||||
|
Poco::Crypto::uninitializeCrypto();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
85
NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp
Normal file
85
NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
//
|
||||||
|
// SecureSMTPClientSession.h
|
||||||
|
//
|
||||||
|
// $Id: //poco/1.4/NetSSL_OpenSSL/src/SecureSMTPClientSession.cpp#1 $
|
||||||
|
//
|
||||||
|
// Library: NetSSL_OpenSSL
|
||||||
|
// Package: Mail
|
||||||
|
// Module: SecureSMTPClientSession
|
||||||
|
//
|
||||||
|
// Copyright (c) 2010, Applied Informatics Software Engineering GmbH.
|
||||||
|
// and Contributors.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
|
// obtaining a copy of the software and accompanying documentation covered by
|
||||||
|
// this license (the "Software") to use, reproduce, display, distribute,
|
||||||
|
// execute, and transmit the Software, and to prepare derivative works of the
|
||||||
|
// Software, and to permit third-parties to whom the Software is furnished to
|
||||||
|
// do so, all subject to the following:
|
||||||
|
//
|
||||||
|
// The copyright notices in the Software and this entire statement, including
|
||||||
|
// the above license grant, this restriction and the following disclaimer,
|
||||||
|
// must be included in all copies of the Software, in whole or in part, and
|
||||||
|
// all derivative works of the Software, unless such copies or derivative
|
||||||
|
// works are solely in the form of machine-executable object code generated by
|
||||||
|
// a source language processor.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||||
|
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||||
|
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||||
|
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#include "Poco/Net/SecureSMTPClientSession.h"
|
||||||
|
#include "Poco/Net/SecureStreamSocket.h"
|
||||||
|
#include "Poco/Net/SSLManager.h"
|
||||||
|
#include "Poco/Net/DialogSocket.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Poco {
|
||||||
|
namespace Net {
|
||||||
|
|
||||||
|
|
||||||
|
SecureSMTPClientSession::SecureSMTPClientSession(const StreamSocket& socket):
|
||||||
|
SMTPClientSession(socket)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SecureSMTPClientSession::SecureSMTPClientSession(const std::string& host, Poco::UInt16 port):
|
||||||
|
SMTPClientSession(host, port)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SecureSMTPClientSession::~SecureSMTPClientSession()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SecureSMTPClientSession::startTLS()
|
||||||
|
{
|
||||||
|
return startTLS(SSLManager::instance().defaultClientContext());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SecureSMTPClientSession::startTLS(Context::Ptr pContext)
|
||||||
|
{
|
||||||
|
int status = 0;
|
||||||
|
std::string response;
|
||||||
|
|
||||||
|
status = sendCommand("STARTTLS", response);
|
||||||
|
if (!isPositiveCompletion(status)) return false;
|
||||||
|
|
||||||
|
SecureStreamSocket sss(SecureStreamSocket::attach(socket(), pContext));
|
||||||
|
socket() = sss;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} } // namespace Poco::Net
|
@@ -127,4 +127,10 @@ void SecureServerSocketImpl::sendUrgent(unsigned char data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SecureServerSocketImpl::secure() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
// Package: SSLSockets
|
// Package: SSLSockets
|
||||||
// Module: SecureSocketImpl
|
// Module: SecureSocketImpl
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
#include "Poco/Net/DNS.h"
|
#include "Poco/Net/DNS.h"
|
||||||
#include "Poco/NumberFormatter.h"
|
#include "Poco/NumberFormatter.h"
|
||||||
#include "Poco/NumberParser.h"
|
#include "Poco/NumberParser.h"
|
||||||
|
#include "Poco/Format.h"
|
||||||
#include <openssl/x509v3.h>
|
#include <openssl/x509v3.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
|
||||||
@@ -67,18 +68,25 @@ namespace Net {
|
|||||||
|
|
||||||
|
|
||||||
SecureSocketImpl::SecureSocketImpl(Poco::AutoPtr<SocketImpl> pSocketImpl, Context::Ptr pContext):
|
SecureSocketImpl::SecureSocketImpl(Poco::AutoPtr<SocketImpl> pSocketImpl, Context::Ptr pContext):
|
||||||
_pSSL(0),
|
_pSSL(0),
|
||||||
_pSocket(pSocketImpl),
|
_pSocket(pSocketImpl),
|
||||||
_pContext(pContext)
|
_pContext(pContext),
|
||||||
|
_needHandshake(false)
|
||||||
{
|
{
|
||||||
poco_check_ptr (_pSocket);
|
poco_check_ptr (_pSocket);
|
||||||
poco_check_ptr (_pContext);
|
poco_check_ptr (_pContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SecureSocketImpl::~SecureSocketImpl()
|
SecureSocketImpl::~SecureSocketImpl()
|
||||||
{
|
{
|
||||||
close();
|
try
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -98,117 +106,92 @@ void SecureSocketImpl::acceptSSL()
|
|||||||
{
|
{
|
||||||
poco_assert (!_pSSL);
|
poco_assert (!_pSSL);
|
||||||
|
|
||||||
BIO* pBIO = BIO_new(BIO_s_socket());
|
BIO* pBIO = BIO_new(BIO_s_socket());
|
||||||
if (!pBIO) throw SSLException("Cannot create BIO object");
|
if (!pBIO) throw SSLException("Cannot create BIO object");
|
||||||
BIO_set_fd(pBIO, _pSocket->sockfd(), BIO_NOCLOSE);
|
BIO_set_fd(pBIO, static_cast<int>(_pSocket->sockfd()), BIO_NOCLOSE);
|
||||||
|
|
||||||
_pSSL = SSL_new(_pContext->sslContext());
|
_pSSL = SSL_new(_pContext->sslContext());
|
||||||
if (!_pSSL)
|
if (!_pSSL)
|
||||||
|
{
|
||||||
|
BIO_free(pBIO);
|
||||||
|
throw SSLException("Cannot create SSL object");
|
||||||
|
}
|
||||||
|
SSL_set_bio(_pSSL, pBIO, pBIO);
|
||||||
|
SSL_set_accept_state(_pSSL);
|
||||||
|
_needHandshake = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureSocketImpl::connect(const SocketAddress& address, bool performHandshake)
|
||||||
|
{
|
||||||
|
if (_pSSL) reset();
|
||||||
|
|
||||||
|
poco_assert (!_pSSL);
|
||||||
|
|
||||||
|
_pSocket->connect(address);
|
||||||
|
connectSSL(performHandshake);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout, bool performHandshake)
|
||||||
|
{
|
||||||
|
if (_pSSL) reset();
|
||||||
|
|
||||||
|
poco_assert (!_pSSL);
|
||||||
|
|
||||||
|
_pSocket->connect(address, timeout);
|
||||||
|
connectSSL(performHandshake);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureSocketImpl::connectNB(const SocketAddress& address)
|
||||||
|
{
|
||||||
|
if (_pSSL) reset();
|
||||||
|
|
||||||
|
poco_assert (!_pSSL);
|
||||||
|
|
||||||
|
_pSocket->connectNB(address);
|
||||||
|
connectSSL(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureSocketImpl::connectSSL(bool performHandshake)
|
||||||
|
{
|
||||||
|
poco_assert (!_pSSL);
|
||||||
|
poco_assert (_pSocket->initialized());
|
||||||
|
|
||||||
|
BIO* pBIO = BIO_new(BIO_s_socket());
|
||||||
|
if (!pBIO) throw SSLException("Cannot create SSL BIO object");
|
||||||
|
BIO_set_fd(pBIO, static_cast<int>(_pSocket->sockfd()), BIO_NOCLOSE);
|
||||||
|
|
||||||
|
_pSSL = SSL_new(_pContext->sslContext());
|
||||||
|
if (!_pSSL)
|
||||||
{
|
{
|
||||||
BIO_free(pBIO);
|
BIO_free(pBIO);
|
||||||
throw SSLException("Cannot create SSL object");
|
throw SSLException("Cannot create SSL object");
|
||||||
}
|
}
|
||||||
SSL_set_bio(_pSSL, pBIO, pBIO);
|
SSL_set_bio(_pSSL, pBIO, pBIO);
|
||||||
|
|
||||||
try
|
if (_pSession)
|
||||||
{
|
{
|
||||||
if (_pSocket->getBlocking())
|
SSL_set_session(_pSSL, _pSession->sslSession());
|
||||||
{
|
}
|
||||||
int err = SSL_accept(_pSSL);
|
|
||||||
if (err > 0)
|
|
||||||
{
|
|
||||||
std::string clientName = _pSocket->peerAddress().host().toString();
|
|
||||||
long certErr = verifyCertificate(clientName);
|
|
||||||
if (certErr != X509_V_OK)
|
|
||||||
{
|
|
||||||
std::string msg = Utility::convertCertificateError(certErr);
|
|
||||||
throw CertificateValidationException("Unacceptable certificate from " + clientName, msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
handleError(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SSL_set_accept_state(_pSSL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
SSL_shutdown(_pSSL);
|
|
||||||
SSL_free(_pSSL);
|
|
||||||
_pSSL = 0;
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
try
|
||||||
void SecureSocketImpl::connect(const SocketAddress& address, const std::string& hostName)
|
{
|
||||||
{
|
if (performHandshake && _pSocket->getBlocking())
|
||||||
poco_assert (!_pSSL);
|
{
|
||||||
|
int ret = SSL_connect(_pSSL);
|
||||||
_pSocket->connect(address);
|
handleError(ret);
|
||||||
connectSSL(hostName);
|
verifyPeerCertificate();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
void SecureSocketImpl::connect(const SocketAddress& address, const std::string& hostName, const Poco::Timespan& timeout)
|
SSL_set_connect_state(_pSSL);
|
||||||
{
|
_needHandshake = true;
|
||||||
poco_assert (!_pSSL);
|
}
|
||||||
|
}
|
||||||
_pSocket->connect(address, timeout);
|
catch (...)
|
||||||
connectSSL(hostName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SecureSocketImpl::connectNB(const SocketAddress& address, const std::string& hostName)
|
|
||||||
{
|
|
||||||
poco_assert (!_pSSL);
|
|
||||||
|
|
||||||
_pSocket->connectNB(address);
|
|
||||||
connectSSL(hostName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SecureSocketImpl::connectSSL(const std::string& hostName)
|
|
||||||
{
|
|
||||||
poco_assert (!_pSSL);
|
|
||||||
poco_assert (_pSocket->initialized());
|
|
||||||
|
|
||||||
BIO* pBIO = BIO_new(BIO_s_socket());
|
|
||||||
if (!pBIO) throw SSLException("Cannot create SSL BIO object");
|
|
||||||
BIO_set_fd(pBIO, _pSocket->sockfd(), BIO_NOCLOSE);
|
|
||||||
|
|
||||||
_pSSL = SSL_new(_pContext->sslContext());
|
|
||||||
if (!_pSSL)
|
|
||||||
{
|
|
||||||
BIO_free(pBIO);
|
|
||||||
throw SSLException("Cannot create SSL object");
|
|
||||||
}
|
|
||||||
SSL_set_bio(_pSSL, pBIO, pBIO);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (_pSocket->getBlocking())
|
|
||||||
{
|
|
||||||
int ret = SSL_connect(_pSSL);
|
|
||||||
handleError(ret);
|
|
||||||
|
|
||||||
long certErr = verifyCertificate(hostName);
|
|
||||||
if (certErr != X509_V_OK)
|
|
||||||
{
|
|
||||||
std::string msg = Utility::convertCertificateError(certErr);
|
|
||||||
throw InvalidCertificateException(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SSL_set_connect_state(_pSSL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
{
|
||||||
SSL_free(_pSSL);
|
SSL_free(_pSSL);
|
||||||
_pSSL = 0;
|
_pSSL = 0;
|
||||||
@@ -235,24 +218,29 @@ void SecureSocketImpl::listen(int backlog)
|
|||||||
|
|
||||||
void SecureSocketImpl::shutdown()
|
void SecureSocketImpl::shutdown()
|
||||||
{
|
{
|
||||||
if (_pSSL)
|
if (_pSSL)
|
||||||
{
|
{
|
||||||
// A proper clean shutdown would require us to
|
// Don't shut down the socket more than once.
|
||||||
// retry the shutdown if we get a zero return
|
int shutdownState = SSL_get_shutdown(_pSSL);
|
||||||
// value, until SSL_shutdown() returns 1.
|
bool shutdownSent = (shutdownState & SSL_SENT_SHUTDOWN) == SSL_SENT_SHUTDOWN;
|
||||||
// However, this will lead to problems with
|
if (!shutdownSent)
|
||||||
// most web browsers, so we just set the shutdown
|
{
|
||||||
// flag by calling SSL_shutdown() once and be
|
// A proper clean shutdown would require us to
|
||||||
// done with it.
|
// retry the shutdown if we get a zero return
|
||||||
int rc = SSL_shutdown(_pSSL);
|
// value, until SSL_shutdown() returns 1.
|
||||||
if (rc < 0) handleError(rc);
|
// However, this will lead to problems with
|
||||||
SSL_clear(_pSSL);
|
// most web browsers, so we just set the shutdown
|
||||||
SSL_free(_pSSL);
|
// flag by calling SSL_shutdown() once and be
|
||||||
_pSSL = 0;
|
// done with it.
|
||||||
}
|
int rc = SSL_shutdown(_pSSL);
|
||||||
|
if (rc < 0) handleError(rc);
|
||||||
|
SSL_clear(_pSSL);
|
||||||
|
SSL_free(_pSSL);
|
||||||
|
_pSSL = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SecureSocketImpl::close()
|
void SecureSocketImpl::close()
|
||||||
{
|
{
|
||||||
shutdown();
|
shutdown();
|
||||||
@@ -263,31 +251,50 @@ void SecureSocketImpl::close()
|
|||||||
int SecureSocketImpl::sendBytes(const void* buffer, int length, int flags)
|
int SecureSocketImpl::sendBytes(const void* buffer, int length, int flags)
|
||||||
{
|
{
|
||||||
poco_assert (_pSocket->initialized());
|
poco_assert (_pSocket->initialized());
|
||||||
poco_check_ptr (_pSSL);
|
poco_check_ptr (_pSSL);
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
do
|
if (_needHandshake)
|
||||||
{
|
{
|
||||||
rc = SSL_write(_pSSL, buffer, length);
|
rc = completeHandshake();
|
||||||
|
if (rc == 1)
|
||||||
|
verifyPeerCertificate();
|
||||||
|
else if (rc == 0)
|
||||||
|
throw SSLConnectionUnexpectedlyClosedException();
|
||||||
|
else
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
do
|
||||||
|
{
|
||||||
|
rc = SSL_write(_pSSL, buffer, length);
|
||||||
}
|
}
|
||||||
while (rc <= 0 && _pSocket->lastError() == POCO_EINTR);
|
while (rc <= 0 && _pSocket->lastError() == POCO_EINTR);
|
||||||
if (rc <= 0)
|
if (rc <= 0)
|
||||||
{
|
{
|
||||||
return handleError(rc);
|
rc = handleError(rc);
|
||||||
}
|
if (rc == 0) throw SSLConnectionUnexpectedlyClosedException();
|
||||||
return rc;
|
}
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SecureSocketImpl::receiveBytes(void* buffer, int length, int flags)
|
int SecureSocketImpl::receiveBytes(void* buffer, int length, int flags)
|
||||||
{
|
{
|
||||||
poco_assert (_pSocket->initialized());
|
poco_assert (_pSocket->initialized());
|
||||||
poco_check_ptr (_pSSL);
|
poco_check_ptr (_pSSL);
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
do
|
if (_needHandshake)
|
||||||
{
|
{
|
||||||
rc = SSL_read(_pSSL, buffer, length);
|
rc = completeHandshake();
|
||||||
|
if (rc == 1)
|
||||||
|
verifyPeerCertificate();
|
||||||
|
else
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
do
|
||||||
|
{
|
||||||
|
rc = SSL_read(_pSSL, buffer, length);
|
||||||
}
|
}
|
||||||
while (rc <= 0 && _pSocket->lastError() == POCO_EINTR);
|
while (rc <= 0 && _pSocket->lastError() == POCO_EINTR);
|
||||||
if (rc <= 0)
|
if (rc <= 0)
|
||||||
@@ -298,24 +305,72 @@ int SecureSocketImpl::receiveBytes(void* buffer, int length, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
long SecureSocketImpl::verifyCertificate(const std::string& hostName)
|
int SecureSocketImpl::available() const
|
||||||
{
|
{
|
||||||
Context::VerificationMode mode = _pContext->verificationMode();
|
poco_check_ptr (_pSSL);
|
||||||
if (mode == Context::VERIFY_NONE || (isLocalHost(hostName) && mode != Context::VERIFY_STRICT))
|
|
||||||
{
|
|
||||||
return X509_V_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
X509* pCert = SSL_get_peer_certificate(_pSSL);
|
return SSL_pending(_pSSL);
|
||||||
if (pCert)
|
|
||||||
{
|
|
||||||
X509Certificate cert(pCert);
|
|
||||||
return cert.verify(hostName);
|
|
||||||
}
|
|
||||||
else return X509_V_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SecureSocketImpl::completeHandshake()
|
||||||
|
{
|
||||||
|
poco_assert (_pSocket->initialized());
|
||||||
|
poco_check_ptr (_pSSL);
|
||||||
|
|
||||||
|
int rc;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
rc = SSL_do_handshake(_pSSL);
|
||||||
|
}
|
||||||
|
while (rc <= 0 && _pSocket->lastError() == POCO_EINTR);
|
||||||
|
if (rc <= 0)
|
||||||
|
{
|
||||||
|
return handleError(rc);
|
||||||
|
}
|
||||||
|
_needHandshake = false;
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureSocketImpl::verifyPeerCertificate()
|
||||||
|
{
|
||||||
|
if (_peerHostName.empty())
|
||||||
|
_peerHostName = _pSocket->peerAddress().host().toString();
|
||||||
|
|
||||||
|
verifyPeerCertificate(_peerHostName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureSocketImpl::verifyPeerCertificate(const std::string& hostName)
|
||||||
|
{
|
||||||
|
long certErr = verifyPeerCertificateImpl(hostName);
|
||||||
|
if (certErr != X509_V_OK)
|
||||||
|
{
|
||||||
|
std::string msg = Utility::convertCertificateError(certErr);
|
||||||
|
throw CertificateValidationException("Unacceptable certificate from " + hostName, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
long SecureSocketImpl::verifyPeerCertificateImpl(const std::string& hostName)
|
||||||
|
{
|
||||||
|
Context::VerificationMode mode = _pContext->verificationMode();
|
||||||
|
if (mode == Context::VERIFY_NONE || !_pContext->extendedCertificateVerificationEnabled() ||
|
||||||
|
(isLocalHost(hostName) && mode != Context::VERIFY_STRICT))
|
||||||
|
{
|
||||||
|
return X509_V_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
X509* pCert = SSL_get_peer_certificate(_pSSL);
|
||||||
|
if (pCert)
|
||||||
|
{
|
||||||
|
X509Certificate cert(pCert);
|
||||||
|
return cert.verify(hostName) ? X509_V_OK : X509_V_ERR_APPLICATION_VERIFICATION;
|
||||||
|
}
|
||||||
|
else return X509_V_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SecureSocketImpl::isLocalHost(const std::string& hostName)
|
bool SecureSocketImpl::isLocalHost(const std::string& hostName)
|
||||||
{
|
{
|
||||||
@@ -349,37 +404,91 @@ int SecureSocketImpl::handleError(int rc)
|
|||||||
case SSL_ERROR_WANT_CONNECT:
|
case SSL_ERROR_WANT_CONNECT:
|
||||||
case SSL_ERROR_WANT_ACCEPT:
|
case SSL_ERROR_WANT_ACCEPT:
|
||||||
case SSL_ERROR_WANT_X509_LOOKUP:
|
case SSL_ERROR_WANT_X509_LOOKUP:
|
||||||
// these should not occur
|
// these should not occur
|
||||||
poco_bugcheck();
|
poco_bugcheck();
|
||||||
return rc;
|
return rc;
|
||||||
case SSL_ERROR_SYSCALL:
|
default:
|
||||||
case SSL_ERROR_SSL:
|
{
|
||||||
{
|
long lastError = ERR_get_error();
|
||||||
long lastError = ERR_get_error();
|
if (lastError == 0)
|
||||||
if (lastError == 0)
|
{
|
||||||
{
|
if (rc == 0)
|
||||||
if (rc == 0)
|
{
|
||||||
{
|
throw SSLConnectionUnexpectedlyClosedException();
|
||||||
throw SSLException("The underlying socket connection has been unexpectedly closed");
|
}
|
||||||
}
|
else
|
||||||
else if (rc == -1)
|
{
|
||||||
{
|
SecureStreamSocketImpl::error(Poco::format("The BIO reported an error: %d", rc));
|
||||||
SecureStreamSocketImpl::error("The BIO reported an error");
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
ERR_error_string_n(lastError, buffer, sizeof(buffer));
|
ERR_error_string_n(lastError, buffer, sizeof(buffer));
|
||||||
std::string msg(buffer);
|
std::string msg(buffer);
|
||||||
throw SSLException(msg);
|
throw SSLException(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
}
|
||||||
break;
|
return rc;
|
||||||
}
|
}
|
||||||
return rc;
|
|
||||||
|
|
||||||
|
void SecureSocketImpl::setPeerHostName(const std::string& peerHostName)
|
||||||
|
{
|
||||||
|
_peerHostName = peerHostName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureSocketImpl::reset()
|
||||||
|
{
|
||||||
|
close();
|
||||||
|
if (_pSSL)
|
||||||
|
{
|
||||||
|
SSL_free(_pSSL);
|
||||||
|
_pSSL = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureSocketImpl::abort()
|
||||||
|
{
|
||||||
|
_pSocket->shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Session::Ptr SecureSocketImpl::currentSession()
|
||||||
|
{
|
||||||
|
if (_pSSL)
|
||||||
|
{
|
||||||
|
SSL_SESSION* pSession = SSL_get1_session(_pSSL);
|
||||||
|
if (pSession)
|
||||||
|
{
|
||||||
|
if (_pSession && pSession == _pSession->sslSession())
|
||||||
|
{
|
||||||
|
SSL_SESSION_free(pSession);
|
||||||
|
return _pSession;
|
||||||
|
}
|
||||||
|
else return new Session(pSession);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureSocketImpl::useSession(Session::Ptr pSession)
|
||||||
|
{
|
||||||
|
_pSession = pSession;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SecureSocketImpl::sessionWasReused()
|
||||||
|
{
|
||||||
|
if (_pSSL)
|
||||||
|
return SSL_session_reused(_pSSL) != 0;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
// Package: SSLSockets
|
// Package: SSLSockets
|
||||||
// Module: SecureStreamSocket
|
// Module: SecureStreamSocket
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@@ -60,8 +60,15 @@ SecureStreamSocket::SecureStreamSocket(Context::Ptr pContext):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SecureStreamSocket::SecureStreamSocket(Context::Ptr pContext, Session::Ptr pSession):
|
||||||
|
StreamSocket(new SecureStreamSocketImpl(pContext))
|
||||||
|
{
|
||||||
|
useSession(pSession);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address):
|
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address):
|
||||||
StreamSocket(new SecureStreamSocketImpl(SSLManager::instance().defaultClientContext()))
|
StreamSocket(new SecureStreamSocketImpl(SSLManager::instance().defaultClientContext()))
|
||||||
{
|
{
|
||||||
connect(address);
|
connect(address);
|
||||||
}
|
}
|
||||||
@@ -82,16 +89,33 @@ SecureStreamSocket::SecureStreamSocket(const SocketAddress& address, Context::Pt
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address, Context::Ptr pContext, Session::Ptr pSession):
|
||||||
|
StreamSocket(new SecureStreamSocketImpl(pContext))
|
||||||
|
{
|
||||||
|
useSession(pSession);
|
||||||
|
connect(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address, const std::string& hostName, Context::Ptr pContext):
|
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address, const std::string& hostName, Context::Ptr pContext):
|
||||||
StreamSocket(new SecureStreamSocketImpl(pContext))
|
StreamSocket(new SecureStreamSocketImpl(pContext))
|
||||||
{
|
{
|
||||||
static_cast<SecureStreamSocketImpl*>(impl())->setPeerHostName(hostName);
|
static_cast<SecureStreamSocketImpl*>(impl())->setPeerHostName(hostName);
|
||||||
connect(address);
|
connect(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address, const std::string& hostName, Context::Ptr pContext, Session::Ptr pSession):
|
||||||
|
StreamSocket(new SecureStreamSocketImpl(pContext))
|
||||||
|
{
|
||||||
|
static_cast<SecureStreamSocketImpl*>(impl())->setPeerHostName(hostName);
|
||||||
|
useSession(pSession);
|
||||||
|
connect(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SecureStreamSocket::SecureStreamSocket(const Socket& socket):
|
SecureStreamSocket::SecureStreamSocket(const Socket& socket):
|
||||||
StreamSocket(socket)
|
StreamSocket(socket)
|
||||||
{
|
{
|
||||||
if (!dynamic_cast<SecureStreamSocketImpl*>(impl()))
|
if (!dynamic_cast<SecureStreamSocketImpl*>(impl()))
|
||||||
throw InvalidArgumentException("Cannot assign incompatible socket");
|
throw InvalidArgumentException("Cannot assign incompatible socket");
|
||||||
@@ -121,9 +145,15 @@ SecureStreamSocket& SecureStreamSocket::operator = (const Socket& socket)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SecureStreamSocket::havePeerCertificate() const
|
||||||
|
{
|
||||||
|
return static_cast<SecureStreamSocketImpl*>(impl())->havePeerCertificate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
X509Certificate SecureStreamSocket::peerCertificate() const
|
X509Certificate SecureStreamSocket::peerCertificate() const
|
||||||
{
|
{
|
||||||
return static_cast<SecureStreamSocketImpl*>(impl())->peerCertificate();
|
return static_cast<SecureStreamSocketImpl*>(impl())->peerCertificate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -157,9 +187,19 @@ SecureStreamSocket SecureStreamSocket::attach(const StreamSocket& streamSocket,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SecureStreamSocket SecureStreamSocket::attach(const StreamSocket& streamSocket, Context::Ptr pContext, Session::Ptr pSession)
|
||||||
|
{
|
||||||
|
SecureStreamSocketImpl* pImpl = new SecureStreamSocketImpl(static_cast<StreamSocketImpl*>(streamSocket.impl()), pContext);
|
||||||
|
SecureStreamSocket result(pImpl);
|
||||||
|
result.useSession(pSession);
|
||||||
|
pImpl->connectSSL();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SecureStreamSocket SecureStreamSocket::attach(const StreamSocket& streamSocket, const std::string& peerHostName)
|
SecureStreamSocket SecureStreamSocket::attach(const StreamSocket& streamSocket, const std::string& peerHostName)
|
||||||
{
|
{
|
||||||
SecureStreamSocketImpl* pImpl = new SecureStreamSocketImpl(static_cast<StreamSocketImpl*>(streamSocket.impl()), SSLManager::instance().defaultClientContext());
|
SecureStreamSocketImpl* pImpl = new SecureStreamSocketImpl(static_cast<StreamSocketImpl*>(streamSocket.impl()), SSLManager::instance().defaultClientContext());
|
||||||
SecureStreamSocket result(pImpl);
|
SecureStreamSocket result(pImpl);
|
||||||
result.setPeerHostName(peerHostName);
|
result.setPeerHostName(peerHostName);
|
||||||
pImpl->connectSSL();
|
pImpl->connectSSL();
|
||||||
@@ -177,9 +217,74 @@ SecureStreamSocket SecureStreamSocket::attach(const StreamSocket& streamSocket,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SecureStreamSocket SecureStreamSocket::attach(const StreamSocket& streamSocket, const std::string& peerHostName, Context::Ptr pContext, Session::Ptr pSession)
|
||||||
|
{
|
||||||
|
SecureStreamSocketImpl* pImpl = new SecureStreamSocketImpl(static_cast<StreamSocketImpl*>(streamSocket.impl()), pContext);
|
||||||
|
SecureStreamSocket result(pImpl);
|
||||||
|
result.setPeerHostName(peerHostName);
|
||||||
|
result.useSession(pSession);
|
||||||
|
pImpl->connectSSL();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Context::Ptr SecureStreamSocket::context() const
|
Context::Ptr SecureStreamSocket::context() const
|
||||||
{
|
{
|
||||||
return static_cast<SecureStreamSocketImpl*>(impl())->context();
|
return static_cast<SecureStreamSocketImpl*>(impl())->context();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureStreamSocket::setLazyHandshake(bool flag)
|
||||||
|
{
|
||||||
|
static_cast<SecureStreamSocketImpl*>(impl())->setLazyHandshake(flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SecureStreamSocket::getLazyHandshake() const
|
||||||
|
{
|
||||||
|
return static_cast<SecureStreamSocketImpl*>(impl())->getLazyHandshake();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureStreamSocket::verifyPeerCertificate()
|
||||||
|
{
|
||||||
|
static_cast<SecureStreamSocketImpl*>(impl())->verifyPeerCertificate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureStreamSocket::verifyPeerCertificate(const std::string& hostName)
|
||||||
|
{
|
||||||
|
static_cast<SecureStreamSocketImpl*>(impl())->verifyPeerCertificate(hostName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SecureStreamSocket::completeHandshake()
|
||||||
|
{
|
||||||
|
return static_cast<SecureStreamSocketImpl*>(impl())->completeHandshake();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Session::Ptr SecureStreamSocket::currentSession()
|
||||||
|
{
|
||||||
|
return static_cast<SecureStreamSocketImpl*>(impl())->currentSession();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureStreamSocket::useSession(Session::Ptr pSession)
|
||||||
|
{
|
||||||
|
static_cast<SecureStreamSocketImpl*>(impl())->useSession(pSession);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SecureStreamSocket::sessionWasReused()
|
||||||
|
{
|
||||||
|
return static_cast<SecureStreamSocketImpl*>(impl())->sessionWasReused();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureStreamSocket::abort()
|
||||||
|
{
|
||||||
|
static_cast<SecureStreamSocketImpl*>(impl())->abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
// Package: SSLSockets
|
// Package: SSLSockets
|
||||||
// Module: SecureStreamSocketImpl
|
// Module: SecureStreamSocketImpl
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
#include "Poco/Net/SecureStreamSocketImpl.h"
|
#include "Poco/Net/SecureStreamSocketImpl.h"
|
||||||
#include "Poco/Net/SSLException.h"
|
#include "Poco/Net/SSLException.h"
|
||||||
|
#include "Poco/Thread.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
@@ -43,22 +44,23 @@ namespace Net {
|
|||||||
|
|
||||||
|
|
||||||
SecureStreamSocketImpl::SecureStreamSocketImpl(Context::Ptr pContext):
|
SecureStreamSocketImpl::SecureStreamSocketImpl(Context::Ptr pContext):
|
||||||
_impl(new StreamSocketImpl, pContext)
|
_impl(new StreamSocketImpl, pContext),
|
||||||
|
_lazyHandshake(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SecureStreamSocketImpl::SecureStreamSocketImpl(StreamSocketImpl* pStreamSocket, Context::Ptr pContext):
|
SecureStreamSocketImpl::SecureStreamSocketImpl(StreamSocketImpl* pStreamSocket, Context::Ptr pContext):
|
||||||
_impl(pStreamSocket, pContext)
|
_impl(pStreamSocket, pContext),
|
||||||
|
_lazyHandshake(false)
|
||||||
{
|
{
|
||||||
pStreamSocket->duplicate();
|
pStreamSocket->duplicate();
|
||||||
reset(_impl.sockfd());
|
reset(_impl.sockfd());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SecureStreamSocketImpl::~SecureStreamSocketImpl()
|
SecureStreamSocketImpl::~SecureStreamSocketImpl()
|
||||||
{
|
{
|
||||||
reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -76,32 +78,28 @@ void SecureStreamSocketImpl::acceptSSL()
|
|||||||
|
|
||||||
void SecureStreamSocketImpl::connect(const SocketAddress& address)
|
void SecureStreamSocketImpl::connect(const SocketAddress& address)
|
||||||
{
|
{
|
||||||
if (_peerHostName.empty()) _peerHostName = address.host().toString();
|
_impl.connect(address, !_lazyHandshake);
|
||||||
_impl.connect(address, _peerHostName);
|
reset(_impl.sockfd());
|
||||||
reset(_impl.sockfd());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SecureStreamSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout)
|
void SecureStreamSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout)
|
||||||
{
|
{
|
||||||
if (_peerHostName.empty()) _peerHostName = address.host().toString();
|
_impl.connect(address, timeout, !_lazyHandshake);
|
||||||
_impl.connect(address, _peerHostName, timeout);
|
reset(_impl.sockfd());
|
||||||
reset(_impl.sockfd());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SecureStreamSocketImpl::connectNB(const SocketAddress& address)
|
void SecureStreamSocketImpl::connectNB(const SocketAddress& address)
|
||||||
{
|
{
|
||||||
if (_peerHostName.empty()) _peerHostName = address.host().toString();
|
_impl.connectNB(address);
|
||||||
_impl.connectNB(address, _peerHostName);
|
reset(_impl.sockfd());
|
||||||
reset(_impl.sockfd());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SecureStreamSocketImpl::connectSSL()
|
void SecureStreamSocketImpl::connectSSL()
|
||||||
{
|
{
|
||||||
if (_peerHostName.empty()) _peerHostName = peerAddress().host().toString();
|
_impl.connectSSL(!_lazyHandshake);
|
||||||
_impl.connectSSL(_peerHostName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -124,17 +122,32 @@ void SecureStreamSocketImpl::close()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureStreamSocketImpl::abort()
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
_impl.abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int SecureStreamSocketImpl::sendBytes(const void* buffer, int length, int flags)
|
int SecureStreamSocketImpl::sendBytes(const void* buffer, int length, int flags)
|
||||||
{
|
{
|
||||||
const char* p = reinterpret_cast<const char*>(buffer);
|
const char* p = reinterpret_cast<const char*>(buffer);
|
||||||
int remaining = length;
|
int remaining = length;
|
||||||
while (remaining > 0)
|
int sent = 0;
|
||||||
{
|
bool blocking = getBlocking();
|
||||||
int n = _impl.sendBytes(p, length, flags);
|
while (remaining > 0)
|
||||||
p += n;
|
{
|
||||||
remaining -= n;
|
int n = _impl.sendBytes(p, remaining, flags);
|
||||||
}
|
if (n < 0 && !blocking) return n;
|
||||||
return length;
|
p += n;
|
||||||
|
sent += n;
|
||||||
|
remaining -= n;
|
||||||
|
if (blocking && remaining > 0)
|
||||||
|
Poco::Thread::yield();
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return sent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -162,6 +175,12 @@ void SecureStreamSocketImpl::sendUrgent(unsigned char data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SecureStreamSocketImpl::available()
|
||||||
|
{
|
||||||
|
return _impl.available();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SecureStreamSocketImpl::shutdownReceive()
|
void SecureStreamSocketImpl::shutdownReceive()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -178,19 +197,61 @@ void SecureStreamSocketImpl::shutdown()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SecureStreamSocketImpl::setPeerHostName(const std::string& peerHostName)
|
bool SecureStreamSocketImpl::secure() const
|
||||||
{
|
{
|
||||||
_peerHostName = peerHostName;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SecureStreamSocketImpl::havePeerCertificate() const
|
||||||
|
{
|
||||||
|
X509* pCert = _impl.peerCertificate();
|
||||||
|
if (pCert)
|
||||||
|
{
|
||||||
|
X509_free(pCert);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
X509Certificate SecureStreamSocketImpl::peerCertificate() const
|
X509Certificate SecureStreamSocketImpl::peerCertificate() const
|
||||||
{
|
{
|
||||||
X509* pCert = _impl.peerCertificate();
|
X509* pCert = _impl.peerCertificate();
|
||||||
if (pCert)
|
if (pCert)
|
||||||
return X509Certificate(pCert);
|
return X509Certificate(pCert);
|
||||||
else
|
else
|
||||||
throw SSLException("No certificate available yet");
|
throw SSLException("No certificate available");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureStreamSocketImpl::setLazyHandshake(bool flag)
|
||||||
|
{
|
||||||
|
_lazyHandshake = flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SecureStreamSocketImpl::getLazyHandshake() const
|
||||||
|
{
|
||||||
|
return _lazyHandshake;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureStreamSocketImpl::verifyPeerCertificate()
|
||||||
|
{
|
||||||
|
_impl.verifyPeerCertificate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SecureStreamSocketImpl::verifyPeerCertificate(const std::string& hostName)
|
||||||
|
{
|
||||||
|
_impl.verifyPeerCertificate(hostName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int SecureStreamSocketImpl::completeHandshake()
|
||||||
|
{
|
||||||
|
return _impl.completeHandshake();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
62
NetSSL_OpenSSL/src/Session.cpp
Normal file
62
NetSSL_OpenSSL/src/Session.cpp
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
//
|
||||||
|
// Session.cpp
|
||||||
|
//
|
||||||
|
// $Id: //poco/1.4/NetSSL_OpenSSL/src/Session.cpp#2 $
|
||||||
|
//
|
||||||
|
// Library: NetSSL_OpenSSL
|
||||||
|
// Package: SSLCore
|
||||||
|
// Module: Session
|
||||||
|
//
|
||||||
|
// Copyright (c) 2010, Applied Informatics Software Engineering GmbH.
|
||||||
|
// and Contributors.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
|
// obtaining a copy of the software and accompanying documentation covered by
|
||||||
|
// this license (the "Software") to use, reproduce, display, distribute,
|
||||||
|
// execute, and transmit the Software, and to prepare derivative works of the
|
||||||
|
// Software, and to permit third-parties to whom the Software is furnished to
|
||||||
|
// do so, all subject to the following:
|
||||||
|
//
|
||||||
|
// The copyright notices in the Software and this entire statement, including
|
||||||
|
// the above license grant, this restriction and the following disclaimer,
|
||||||
|
// must be included in all copies of the Software, in whole or in part, and
|
||||||
|
// all derivative works of the Software, unless such copies or derivative
|
||||||
|
// works are solely in the form of machine-executable object code generated by
|
||||||
|
// a source language processor.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||||
|
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||||
|
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||||
|
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
// Some OpenSSL functions are deprecated in OS X 10.7
|
||||||
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#include "Poco/Net/Session.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Poco {
|
||||||
|
namespace Net {
|
||||||
|
|
||||||
|
|
||||||
|
Session::Session(SSL_SESSION* pSession):
|
||||||
|
_pSession(pSession)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Session::~Session()
|
||||||
|
{
|
||||||
|
SSL_SESSION_free(_pSession);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} } // namespace Poco::Net
|
@@ -71,8 +71,14 @@ X509Certificate::X509Certificate(X509* pCert):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
X509Certificate::X509Certificate(X509* pCert, bool shared):
|
||||||
|
Poco::Crypto::X509Certificate(pCert, shared)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
X509Certificate::X509Certificate(const Poco::Crypto::X509Certificate& cert):
|
X509Certificate::X509Certificate(const Poco::Crypto::X509Certificate& cert):
|
||||||
Poco::Crypto::X509Certificate(cert)
|
Poco::Crypto::X509Certificate(cert)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,16 +96,16 @@ X509Certificate::~X509Certificate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
long X509Certificate::verify(const std::string& hostName) const
|
bool X509Certificate::verify(const std::string& hostName) const
|
||||||
{
|
{
|
||||||
return verify(*this, hostName);
|
return verify(*this, hostName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
long X509Certificate::verify(const Poco::Crypto::X509Certificate& certificate, const std::string& hostName)
|
bool X509Certificate::verify(const Poco::Crypto::X509Certificate& certificate, const std::string& hostName)
|
||||||
{
|
{
|
||||||
std::string commonName;
|
std::string commonName;
|
||||||
std::set<std::string> dnsNames;
|
std::set<std::string> dnsNames;
|
||||||
certificate.extractNames(commonName, dnsNames);
|
certificate.extractNames(commonName, dnsNames);
|
||||||
bool ok = (dnsNames.find(hostName) != dnsNames.end());
|
bool ok = (dnsNames.find(hostName) != dnsNames.end());
|
||||||
|
|
||||||
@@ -142,18 +148,13 @@ long X509Certificate::verify(const Poco::Crypto::X509Certificate& certificate, c
|
|||||||
ok = matchByAlias(commonName, heData);
|
ok = matchByAlias(commonName, heData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (HostNotFoundException&)
|
catch (HostNotFoundException&)
|
||||||
{
|
{
|
||||||
return X509_V_ERR_APPLICATION_VERIFICATION;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return ok;
|
||||||
// we already have a verify callback registered so no need to ask twice SSL_get_verify_result(pSSL);
|
|
||||||
if (ok)
|
|
||||||
return X509_V_OK;
|
|
||||||
else
|
|
||||||
return X509_V_ERR_APPLICATION_VERIFICATION;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -165,11 +166,12 @@ bool X509Certificate::containsWildcards(const std::string& commonName)
|
|||||||
|
|
||||||
bool X509Certificate::matchByAlias(const std::string& alias, const HostEntry& heData)
|
bool X509Certificate::matchByAlias(const std::string& alias, const HostEntry& heData)
|
||||||
{
|
{
|
||||||
// fix wildcards
|
// fix wildcards
|
||||||
std::string aliasRep = Poco::replace(alias, "*", ".*");
|
std::string aliasRep = Poco::replace(alias, ".", "\\.");
|
||||||
Poco::replaceInPlace(aliasRep, "..*", ".*");
|
Poco::replaceInPlace(aliasRep, "*", ".*");
|
||||||
Poco::replaceInPlace(aliasRep, "?", ".?");
|
Poco::replaceInPlace(aliasRep, "..*", ".*");
|
||||||
Poco::replaceInPlace(aliasRep, "..?", ".?");
|
Poco::replaceInPlace(aliasRep, "?", ".?");
|
||||||
|
Poco::replaceInPlace(aliasRep, "..?", ".?");
|
||||||
// compare by name
|
// compare by name
|
||||||
Poco::RegularExpression expr(aliasRep);
|
Poco::RegularExpression expr(aliasRep);
|
||||||
bool found = false;
|
bool found = false;
|
||||||
@@ -177,10 +179,16 @@ bool X509Certificate::matchByAlias(const std::string& alias, const HostEntry& he
|
|||||||
HostEntry::AliasList::const_iterator it = aliases.begin();
|
HostEntry::AliasList::const_iterator it = aliases.begin();
|
||||||
HostEntry::AliasList::const_iterator itEnd = aliases.end();
|
HostEntry::AliasList::const_iterator itEnd = aliases.end();
|
||||||
for (; it != itEnd && !found; ++it)
|
for (; it != itEnd && !found; ++it)
|
||||||
{
|
{
|
||||||
found = expr.match(*it);
|
found = expr.match(*it);
|
||||||
}
|
}
|
||||||
return found;
|
// Handle the case where the list of aliases is empty.
|
||||||
|
if (aliases.empty())
|
||||||
|
{
|
||||||
|
// Compare the host name against the wildcard host name in the certificate.
|
||||||
|
found = expr.match(heData.name());
|
||||||
|
}
|
||||||
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -39,4 +39,10 @@
|
|||||||
</invalidCertificateHandler>
|
</invalidCertificateHandler>
|
||||||
</client>
|
</client>
|
||||||
</openSSL>
|
</openSSL>
|
||||||
|
<testsuite>
|
||||||
|
<proxy>
|
||||||
|
<host>proxy.aon.at</host>
|
||||||
|
<port>8080</port>
|
||||||
|
</proxy>
|
||||||
|
</testsuite>
|
||||||
</AppConfig>
|
</AppConfig>
|
||||||
|
327
NetSSL_OpenSSL/testsuite/TestSuite_vs100.vcxproj
Normal file
327
NetSSL_OpenSSL/testsuite/TestSuite_vs100.vcxproj
Normal file
@@ -0,0 +1,327 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="debug_shared|Win32">
|
||||||
|
<Configuration>debug_shared</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_md|Win32">
|
||||||
|
<Configuration>debug_static_md</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_mt|Win32">
|
||||||
|
<Configuration>debug_static_mt</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_shared|Win32">
|
||||||
|
<Configuration>release_shared</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_md|Win32">
|
||||||
|
<Configuration>release_static_md</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_mt|Win32">
|
||||||
|
<Configuration>release_static_mt</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectName>TestSuite</ProjectName>
|
||||||
|
<ProjectGuid>{B2B88092-5BCE-4AC0-941E-88167138B4A7}</ProjectGuid>
|
||||||
|
<RootNamespace>TestSuite</RootNamespace>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Static</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Static</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
|
||||||
|
<ImportGroup Label="ExtensionSettings"/>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros"/>
|
||||||
|
<PropertyGroup>
|
||||||
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">bin\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">bin\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">bin\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">bin\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">bin\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">bin\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">obj\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">false</LinkIncremental>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">TestSuited</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">TestSuited</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">TestSuited</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">TestSuite</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">TestSuite</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">TestSuite</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnitd.lib;WinTestRunnerd.lib;libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\TestSuited.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin\TestSuited.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnit.lib;WinTestRunner.lib;libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\TestSuite.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnitmtd.lib;WinTestRunnermtd.lib;iphlpapi.lib;winmm.lib;nafxcwd.lib;libcmtd.lib;WinTestRunner.res;libeay32mtd.lib;ssleay32mtd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_mt\TestSuited.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreSpecificDefaultLibraries>nafxcwd.lib;libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin\static_mt\TestSuited.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnitmt.lib;WinTestRunnermt.lib;iphlpapi.lib;winmm.lib;nafxcw.lib;libcmt.lib;WinTestRunner.res;libeay32mt.lib;ssleay32mt.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_mt\TestSuite.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreSpecificDefaultLibraries>nafxcw.lib;libcmt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnitmdd.lib;WinTestRunnermdd.lib;iphlpapi.lib;winmm.lib;WinTestRunner.res;libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_md\TestSuited.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin\static_md\TestSuited.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnitmd.lib;WinTestRunnermd.lib;iphlpapi.lib;winmm.lib;WinTestRunner.res;libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin\static_md\TestSuite.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="src\HTTPSTestServer.h"/>
|
||||||
|
<ClInclude Include="src\NetSSLTestSuite.h"/>
|
||||||
|
<ClInclude Include="src\TCPServerTest.h"/>
|
||||||
|
<ClInclude Include="src\TCPServerTestSuite.h"/>
|
||||||
|
<ClInclude Include="src\HTTPSServerTest.h"/>
|
||||||
|
<ClInclude Include="src\HTTPSServerTestSuite.h"/>
|
||||||
|
<ClInclude Include="src\HTTPSClientSessionTest.h"/>
|
||||||
|
<ClInclude Include="src\HTTPSClientTestSuite.h"/>
|
||||||
|
<ClInclude Include="src\HTTPSStreamFactoryTest.h"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\HTTPSTestServer.cpp"/>
|
||||||
|
<ClCompile Include="src\NetSSLTestSuite.cpp"/>
|
||||||
|
<ClCompile Include="src\WinDriver.cpp"/>
|
||||||
|
<ClCompile Include="src\TCPServerTest.cpp"/>
|
||||||
|
<ClCompile Include="src\TCPServerTestSuite.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSServerTest.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSServerTestSuite.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSClientSessionTest.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSClientTestSuite.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSStreamFactoryTest.cpp"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
|
||||||
|
<ImportGroup Label="ExtensionTargets"/>
|
||||||
|
</Project>
|
117
NetSSL_OpenSSL/testsuite/TestSuite_vs100.vcxproj.filters
Normal file
117
NetSSL_OpenSSL/testsuite/TestSuite_vs100.vcxproj.filters
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="HTTPS">
|
||||||
|
<UniqueIdentifier>{5895df5f-4143-4260-b683-e386cde3cff2}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPS\Header Files">
|
||||||
|
<UniqueIdentifier>{528d4bf7-ceb2-4f59-a60c-6c8dff658620}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPS\Source Files">
|
||||||
|
<UniqueIdentifier>{92f914f8-3034-4e8a-bb6f-ffc6df85d631}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="_Suite">
|
||||||
|
<UniqueIdentifier>{ff5776a6-1180-4052-8da6-6a4ac9665e3a}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="_Suite\Header Files">
|
||||||
|
<UniqueIdentifier>{6e598184-fe5a-47c9-a2cc-0dd04074224a}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="_Suite\Source Files">
|
||||||
|
<UniqueIdentifier>{2bd4885f-8a91-4332-925f-6d433d619f11}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="_Driver">
|
||||||
|
<UniqueIdentifier>{09d05d97-2fdf-4aff-a6b4-90dfce53e05f}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="_Driver\Source Files">
|
||||||
|
<UniqueIdentifier>{3ebd1ab8-126b-497f-9cee-f37ab9f184d5}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="TCPServer">
|
||||||
|
<UniqueIdentifier>{77dae20e-e3a9-4175-97e9-9b97edb08507}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="TCPServer\Header Files">
|
||||||
|
<UniqueIdentifier>{d3ac07a4-484e-4109-9444-3c3d86da7e8f}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="TCPServer\Source Files">
|
||||||
|
<UniqueIdentifier>{7c09e334-fe1e-4e3a-bbfd-41124384d638}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSServer">
|
||||||
|
<UniqueIdentifier>{9a124b21-907b-4c5b-9e5d-b9886d1cbcfb}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSServer\Header Files">
|
||||||
|
<UniqueIdentifier>{442aaca2-8047-4a39-af4d-5d304e8438ce}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSServer\Source Files">
|
||||||
|
<UniqueIdentifier>{b279c658-75ed-41d9-9c4f-3359cd58a58a}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient">
|
||||||
|
<UniqueIdentifier>{ef15cb54-7f4f-4f20-8122-d744f75abf4a}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient\Header Files">
|
||||||
|
<UniqueIdentifier>{d1800814-817a-4ccb-bd18-87da38e47493}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient\Source Files">
|
||||||
|
<UniqueIdentifier>{d4b01c3c-e317-4cea-8d6e-f87b27823918}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="src\HTTPSTestServer.h">
|
||||||
|
<Filter>HTTPS\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\NetSSLTestSuite.h">
|
||||||
|
<Filter>_Suite\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\TCPServerTest.h">
|
||||||
|
<Filter>TCPServer\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\TCPServerTestSuite.h">
|
||||||
|
<Filter>TCPServer\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\HTTPSServerTest.h">
|
||||||
|
<Filter>HTTPSServer\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\HTTPSServerTestSuite.h">
|
||||||
|
<Filter>HTTPSServer\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\HTTPSClientSessionTest.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\HTTPSClientTestSuite.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\HTTPSStreamFactoryTest.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\HTTPSTestServer.cpp">
|
||||||
|
<Filter>HTTPS\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\NetSSLTestSuite.cpp">
|
||||||
|
<Filter>_Suite\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\WinDriver.cpp">
|
||||||
|
<Filter>_Driver\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\TCPServerTest.cpp">
|
||||||
|
<Filter>TCPServer\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\TCPServerTestSuite.cpp">
|
||||||
|
<Filter>TCPServer\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSServerTest.cpp">
|
||||||
|
<Filter>HTTPSServer\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSServerTestSuite.cpp">
|
||||||
|
<Filter>HTTPSServer\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSClientSessionTest.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSClientTestSuite.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSStreamFactoryTest.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
3
NetSSL_OpenSSL/testsuite/TestSuite_vs100.vcxproj.user
Normal file
3
NetSSL_OpenSSL/testsuite/TestSuite_vs100.vcxproj.user
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
327
NetSSL_OpenSSL/testsuite/TestSuite_x64_vs100.vcxproj
Normal file
327
NetSSL_OpenSSL/testsuite/TestSuite_x64_vs100.vcxproj
Normal file
@@ -0,0 +1,327 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="debug_shared|x64">
|
||||||
|
<Configuration>debug_shared</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_md|x64">
|
||||||
|
<Configuration>debug_static_md</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="debug_static_mt|x64">
|
||||||
|
<Configuration>debug_static_mt</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_shared|x64">
|
||||||
|
<Configuration>release_shared</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_md|x64">
|
||||||
|
<Configuration>release_static_md</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="release_static_mt|x64">
|
||||||
|
<Configuration>release_static_mt</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectName>TestSuite</ProjectName>
|
||||||
|
<ProjectGuid>{B2B88092-5BCE-4AC0-941E-88167138B4A7}</ProjectGuid>
|
||||||
|
<RootNamespace>TestSuite</RootNamespace>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Static</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Static</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/>
|
||||||
|
<ImportGroup Label="ExtensionSettings"/>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'" Label="PropertySheets">
|
||||||
|
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/>
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros"/>
|
||||||
|
<PropertyGroup>
|
||||||
|
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">bin64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">bin64\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">bin64\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">bin64\static_mt\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">false</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">bin64\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">true</LinkIncremental>
|
||||||
|
<OutDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">bin64\static_md\</OutDir>
|
||||||
|
<IntDir Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">obj64\$(Configuration)\</IntDir>
|
||||||
|
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">false</LinkIncremental>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">TestSuited</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">TestSuited</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">TestSuited</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">TestSuite</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">TestSuite</TargetName>
|
||||||
|
<TargetName Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">TestSuite</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnitd.lib;WinTestRunnerd.lib;libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\TestSuited.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin64\TestSuited.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnit.lib;WinTestRunner.lib;libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\TestSuite.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnitmtd.lib;WinTestRunnermtd.lib;iphlpapi.lib;winmm.lib;nafxcwd.lib;libcmtd.lib;WinTestRunner.res;libeay32mtd.lib;ssleay32mtd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_mt\TestSuited.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreSpecificDefaultLibraries>nafxcwd.lib;libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin64\static_mt\TestSuited.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnitmt.lib;WinTestRunnermt.lib;iphlpapi.lib;winmm.lib;nafxcw.lib;libcmt.lib;WinTestRunner.res;libeay32mt.lib;ssleay32mt.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_mt\TestSuite.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreSpecificDefaultLibraries>nafxcw.lib;libcmt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
|
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnitmdd.lib;WinTestRunnermdd.lib;iphlpapi.lib;winmm.lib;WinTestRunner.res;libeay32mdd.lib;ssleay32mdd.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_md\TestSuited.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<ProgramDatabaseFile>bin64\static_md\TestSuited.pdb</ProgramDatabaseFile>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||||
|
<OmitFramePointers>true</OmitFramePointers>
|
||||||
|
<AdditionalIncludeDirectories>..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;..\..\XML\include;..\..\Util\include;..\..\Net\include;..\..\Crypto\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<StringPooling>true</StringPooling>
|
||||||
|
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||||
|
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||||
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
<PrecompiledHeader/>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DebugInformationFormat/>
|
||||||
|
<CompileAs>Default</CompileAs>
|
||||||
|
<DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>CppUnitmd.lib;WinTestRunnermd.lib;iphlpapi.lib;winmm.lib;WinTestRunner.res;libeay32md.lib;ssleay32md.lib;ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<OutputFile>bin64\static_md\TestSuite.exe</OutputFile>
|
||||||
|
<AdditionalLibraryDirectories>..\..\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="src\HTTPSTestServer.h"/>
|
||||||
|
<ClInclude Include="src\NetSSLTestSuite.h"/>
|
||||||
|
<ClInclude Include="src\TCPServerTest.h"/>
|
||||||
|
<ClInclude Include="src\TCPServerTestSuite.h"/>
|
||||||
|
<ClInclude Include="src\HTTPSServerTest.h"/>
|
||||||
|
<ClInclude Include="src\HTTPSServerTestSuite.h"/>
|
||||||
|
<ClInclude Include="src\HTTPSClientSessionTest.h"/>
|
||||||
|
<ClInclude Include="src\HTTPSClientTestSuite.h"/>
|
||||||
|
<ClInclude Include="src\HTTPSStreamFactoryTest.h"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\HTTPSTestServer.cpp"/>
|
||||||
|
<ClCompile Include="src\NetSSLTestSuite.cpp"/>
|
||||||
|
<ClCompile Include="src\WinDriver.cpp"/>
|
||||||
|
<ClCompile Include="src\TCPServerTest.cpp"/>
|
||||||
|
<ClCompile Include="src\TCPServerTestSuite.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSServerTest.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSServerTestSuite.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSClientSessionTest.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSClientTestSuite.cpp"/>
|
||||||
|
<ClCompile Include="src\HTTPSStreamFactoryTest.cpp"/>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
|
||||||
|
<ImportGroup Label="ExtensionTargets"/>
|
||||||
|
</Project>
|
117
NetSSL_OpenSSL/testsuite/TestSuite_x64_vs100.vcxproj.filters
Normal file
117
NetSSL_OpenSSL/testsuite/TestSuite_x64_vs100.vcxproj.filters
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="HTTPS">
|
||||||
|
<UniqueIdentifier>{41d8336b-ebbd-469a-a03a-5aa356c5f23c}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPS\Header Files">
|
||||||
|
<UniqueIdentifier>{13df473e-67e1-4714-8a3d-559e928455c8}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPS\Source Files">
|
||||||
|
<UniqueIdentifier>{70fa29b5-3949-4431-8636-1272e354d7db}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="_Suite">
|
||||||
|
<UniqueIdentifier>{b9af60c8-11ee-4b67-b510-b36a5b364593}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="_Suite\Header Files">
|
||||||
|
<UniqueIdentifier>{00f35a88-516d-4f97-9d46-0c203d68d5d5}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="_Suite\Source Files">
|
||||||
|
<UniqueIdentifier>{b1a13cb4-059d-42a3-9201-f6369bcaeab9}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="_Driver">
|
||||||
|
<UniqueIdentifier>{abba1fbc-a1ee-43f7-b00a-1fbf38b128b5}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="_Driver\Source Files">
|
||||||
|
<UniqueIdentifier>{df0db81a-0dd7-44f1-af2d-d847c19f9d6a}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="TCPServer">
|
||||||
|
<UniqueIdentifier>{7a3f38cf-0627-43c7-aaa3-227e49091562}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="TCPServer\Header Files">
|
||||||
|
<UniqueIdentifier>{8c8100cc-ecd5-47ba-b37e-d0dd6b472b14}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="TCPServer\Source Files">
|
||||||
|
<UniqueIdentifier>{a75ab1bf-3393-4396-b750-43de6352aadf}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSServer">
|
||||||
|
<UniqueIdentifier>{511eb615-3736-4365-a73c-57e5ebb9e4aa}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSServer\Header Files">
|
||||||
|
<UniqueIdentifier>{238f9c19-fc08-4caa-a944-ae4ac7e0535f}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSServer\Source Files">
|
||||||
|
<UniqueIdentifier>{5ab1bb74-2e2e-489e-8d63-bd6f3149f28f}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient">
|
||||||
|
<UniqueIdentifier>{ccc66b68-3941-4879-8aa8-a00e6d386e0e}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient\Header Files">
|
||||||
|
<UniqueIdentifier>{a05be5c6-8c90-4f80-94a0-7f55d3db2fd5}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="HTTPSClient\Source Files">
|
||||||
|
<UniqueIdentifier>{7f0330d0-9a3f-4ec3-ae7c-6e78519e29df}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="src\HTTPSTestServer.h">
|
||||||
|
<Filter>HTTPS\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\NetSSLTestSuite.h">
|
||||||
|
<Filter>_Suite\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\TCPServerTest.h">
|
||||||
|
<Filter>TCPServer\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\TCPServerTestSuite.h">
|
||||||
|
<Filter>TCPServer\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\HTTPSServerTest.h">
|
||||||
|
<Filter>HTTPSServer\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\HTTPSServerTestSuite.h">
|
||||||
|
<Filter>HTTPSServer\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\HTTPSClientSessionTest.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\HTTPSClientTestSuite.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\HTTPSStreamFactoryTest.h">
|
||||||
|
<Filter>HTTPSClient\Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\HTTPSTestServer.cpp">
|
||||||
|
<Filter>HTTPS\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\NetSSLTestSuite.cpp">
|
||||||
|
<Filter>_Suite\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\WinDriver.cpp">
|
||||||
|
<Filter>_Driver\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\TCPServerTest.cpp">
|
||||||
|
<Filter>TCPServer\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\TCPServerTestSuite.cpp">
|
||||||
|
<Filter>TCPServer\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSServerTest.cpp">
|
||||||
|
<Filter>HTTPSServer\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSServerTestSuite.cpp">
|
||||||
|
<Filter>HTTPSServer\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSClientSessionTest.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSClientTestSuite.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\HTTPSStreamFactoryTest.cpp">
|
||||||
|
<Filter>HTTPSClient\Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
</Project>
|
48
NetSSL_OpenSSL/testsuite/TestSuitemt.xml
Normal file
48
NetSSL_OpenSSL/testsuite/TestSuitemt.xml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<AppConfig>
|
||||||
|
<openSSL>
|
||||||
|
<server>
|
||||||
|
<privateKeyFile>${application.configDir}any.pem</privateKeyFile>
|
||||||
|
<caConfig>${application.configDir}rootcert.pem</caConfig>
|
||||||
|
<verificationMode>none</verificationMode>
|
||||||
|
<verificationDepth>9</verificationDepth>
|
||||||
|
<loadDefaultCAFile>true</loadDefaultCAFile>
|
||||||
|
<cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList>
|
||||||
|
<privateKeyPassphraseHandler>
|
||||||
|
<name>KeyFileHandler</name>
|
||||||
|
<options>
|
||||||
|
<password>secret</password>
|
||||||
|
</options>
|
||||||
|
</privateKeyPassphraseHandler>
|
||||||
|
<invalidCertificateHandler>
|
||||||
|
<name>AcceptCertificateHandler</name>
|
||||||
|
<options>
|
||||||
|
</options>
|
||||||
|
</invalidCertificateHandler>
|
||||||
|
</server>
|
||||||
|
<client>
|
||||||
|
<privateKeyFile>${application.configDir}any.pem</privateKeyFile>
|
||||||
|
<caConfig>${application.configDir}rootcert.pem</caConfig>
|
||||||
|
<verificationMode>relaxed</verificationMode>
|
||||||
|
<verificationDepth>9</verificationDepth>
|
||||||
|
<loadDefaultCAFile>true</loadDefaultCAFile>
|
||||||
|
<cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList>
|
||||||
|
<privateKeyPassphraseHandler>
|
||||||
|
<name>KeyFileHandler</name>
|
||||||
|
<options>
|
||||||
|
<password>secret</password>
|
||||||
|
</options>
|
||||||
|
</privateKeyPassphraseHandler>
|
||||||
|
<invalidCertificateHandler>
|
||||||
|
<name>AcceptCertificateHandler</name>
|
||||||
|
<options>
|
||||||
|
</options>
|
||||||
|
</invalidCertificateHandler>
|
||||||
|
</client>
|
||||||
|
</openSSL>
|
||||||
|
<testsuite>
|
||||||
|
<proxy>
|
||||||
|
<host>proxy.aon.at</host>
|
||||||
|
<port>8080</port>
|
||||||
|
</proxy>
|
||||||
|
</testsuite>
|
||||||
|
</AppConfig>
|
@@ -43,42 +43,55 @@
|
|||||||
class NetSSLApp: public Poco::Util::Application
|
class NetSSLApp: public Poco::Util::Application
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NetSSLApp()
|
NetSSLApp()
|
||||||
{
|
{
|
||||||
}
|
Poco::Net::initializeSSL();
|
||||||
|
Poco::Net::HTTPStreamFactory::registerFactory();
|
||||||
|
Poco::Net::HTTPSStreamFactory::registerFactory();
|
||||||
|
}
|
||||||
|
|
||||||
~NetSSLApp()
|
~NetSSLApp()
|
||||||
{
|
{
|
||||||
}
|
Poco::Net::uninitializeSSL();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(const std::vector<std::string>& args)
|
||||||
|
{
|
||||||
|
CppUnit::TestRunner runner;
|
||||||
|
runner.addTest("NetSSLTestSuite", NetSSLTestSuite::suite());
|
||||||
|
return runner.run(_targs) ? 0 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup(int argc, char** argv)
|
||||||
|
{
|
||||||
|
init(1, argv);
|
||||||
|
for (int i = 0; i < argc; ++i)
|
||||||
|
_targs.push_back(std::string(argv[i]));
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initialize(Poco::Util::Application& self)
|
void initialize(Poco::Util::Application& self)
|
||||||
{
|
{
|
||||||
loadConfiguration(); // load default configuration files, if present
|
loadConfiguration(); // load default configuration files, if present
|
||||||
Poco::Util::Application::initialize(self);
|
Poco::Util::Application::initialize(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<std::string> _targs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int main(int ac, char **av)
|
int main(int ac, char **av)
|
||||||
{
|
{
|
||||||
Poco::Net::HTTPStreamFactory::registerFactory();
|
NetSSLApp app;
|
||||||
Poco::Net::HTTPSStreamFactory::registerFactory();
|
try
|
||||||
NetSSLApp app;
|
{
|
||||||
try
|
app.setup(ac, av);
|
||||||
{
|
return app.run();
|
||||||
app.init(1, av);
|
}
|
||||||
}
|
catch (Poco::Exception& exc)
|
||||||
catch (Poco::Exception& exc)
|
{
|
||||||
{
|
std::cout << exc.displayText() << std::endl;
|
||||||
std::cout << exc.displayText() << std::endl;
|
return 1;
|
||||||
return 1;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<std::string> args;
|
|
||||||
for (int i = 0; i < ac; ++i)
|
|
||||||
args.push_back(std::string(av[i]));
|
|
||||||
CppUnit::TestRunner runner;
|
|
||||||
runner.addTest("NetSSLTestSuite", NetSSLTestSuite::suite());
|
|
||||||
return runner.run(args) ? 0 : 1;
|
|
||||||
}
|
}
|
||||||
|
@@ -43,10 +43,16 @@
|
|||||||
#include "Poco/Net/HTTPServerRequest.h"
|
#include "Poco/Net/HTTPServerRequest.h"
|
||||||
#include "Poco/Net/HTTPServerParams.h"
|
#include "Poco/Net/HTTPServerParams.h"
|
||||||
#include "Poco/Net/SecureStreamSocket.h"
|
#include "Poco/Net/SecureStreamSocket.h"
|
||||||
|
#include "Poco/Net/Context.h"
|
||||||
|
#include "Poco/Net/Session.h"
|
||||||
|
#include "Poco/Net/SSLManager.h"
|
||||||
|
#include "Poco/Util/Application.h"
|
||||||
|
#include "Poco/Util/AbstractConfiguration.h"
|
||||||
#include "Poco/StreamCopier.h"
|
#include "Poco/StreamCopier.h"
|
||||||
#include "Poco/Exception.h"
|
#include "Poco/Exception.h"
|
||||||
#include "Poco/DateTimeFormatter.h"
|
#include "Poco/DateTimeFormatter.h"
|
||||||
#include "Poco/DateTimeFormat.h"
|
#include "Poco/DateTimeFormat.h"
|
||||||
|
#include "Poco/Thread.h"
|
||||||
#include "HTTPSTestServer.h"
|
#include "HTTPSTestServer.h"
|
||||||
#include <istream>
|
#include <istream>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
@@ -54,7 +60,9 @@
|
|||||||
|
|
||||||
|
|
||||||
using namespace Poco::Net;
|
using namespace Poco::Net;
|
||||||
|
using Poco::Util::Application;
|
||||||
using Poco::StreamCopier;
|
using Poco::StreamCopier;
|
||||||
|
using Poco::Thread;
|
||||||
|
|
||||||
|
|
||||||
class TestRequestHandler: public HTTPRequestHandler
|
class TestRequestHandler: public HTTPRequestHandler
|
||||||
@@ -281,16 +289,16 @@ void HTTPSClientSessionTest::testKeepAlive()
|
|||||||
s.sendRequest(request);
|
s.sendRequest(request);
|
||||||
std::istream& rs3 = s.receiveResponse(response);
|
std::istream& rs3 = s.receiveResponse(response);
|
||||||
assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH);
|
assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH);
|
||||||
assert (response.getChunkedTransferEncoding());
|
assert (response.getChunkedTransferEncoding());
|
||||||
assert (response.getKeepAlive());
|
assert (response.getKeepAlive());
|
||||||
std::ostringstream ostr3;
|
std::ostringstream ostr3;
|
||||||
int n = StreamCopier::copyStream(rs3, ostr3);
|
StreamCopier::copyStream(rs3, ostr3);
|
||||||
assert (ostr3.str() == HTTPSTestServer::LARGE_BODY);
|
assert (ostr3.str() == HTTPSTestServer::LARGE_BODY);
|
||||||
|
|
||||||
request.setMethod(HTTPRequest::HTTP_HEAD);
|
request.setMethod(HTTPRequest::HTTP_HEAD);
|
||||||
request.setURI("/large");
|
request.setURI("/large");
|
||||||
s.sendRequest(request);
|
s.sendRequest(request);
|
||||||
std::istream& rs4= s.receiveResponse(response);
|
std::istream& rs4 = s.receiveResponse(response);
|
||||||
assert (response.getContentLength() == HTTPSTestServer::LARGE_BODY.length());
|
assert (response.getContentLength() == HTTPSTestServer::LARGE_BODY.length());
|
||||||
assert (response.getContentType() == "text/plain");
|
assert (response.getContentType() == "text/plain");
|
||||||
assert (!response.getKeepAlive());
|
assert (!response.getKeepAlive());
|
||||||
@@ -317,12 +325,15 @@ void HTTPSClientSessionTest::testInterop()
|
|||||||
|
|
||||||
void HTTPSClientSessionTest::testProxy()
|
void HTTPSClientSessionTest::testProxy()
|
||||||
{
|
{
|
||||||
HTTPSTestServer srv;
|
HTTPSTestServer srv;
|
||||||
HTTPSClientSession s("secure.appinf.com");
|
HTTPSClientSession s("secure.appinf.com");
|
||||||
s.setProxy("proxy.aon.at", 8080);
|
s.setProxy(
|
||||||
HTTPRequest request(HTTPRequest::HTTP_GET, "/public/poco/NetSSL.txt");
|
Application::instance().config().getString("testsuite.proxy.host"),
|
||||||
s.sendRequest(request);
|
Application::instance().config().getInt("testsuite.proxy.port")
|
||||||
X509Certificate cert = s.serverCertificate();
|
);
|
||||||
|
HTTPRequest request(HTTPRequest::HTTP_GET, "/public/poco/NetSSL.txt");
|
||||||
|
s.sendRequest(request);
|
||||||
|
X509Certificate cert = s.serverCertificate();
|
||||||
HTTPResponse response;
|
HTTPResponse response;
|
||||||
std::istream& rs = s.receiveResponse(response);
|
std::istream& rs = s.receiveResponse(response);
|
||||||
std::ostringstream ostr;
|
std::ostringstream ostr;
|
||||||
@@ -333,6 +344,96 @@ void HTTPSClientSessionTest::testProxy()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void HTTPSClientSessionTest::testCachedSession()
|
||||||
|
{
|
||||||
|
// ensure OpenSSL machinery is fully setup
|
||||||
|
Context::Ptr pDefaultServerContext = SSLManager::instance().defaultServerContext();
|
||||||
|
Context::Ptr pDefaultClientContext = SSLManager::instance().defaultClientContext();
|
||||||
|
|
||||||
|
Context::Ptr pServerContext = new Context(
|
||||||
|
Context::SERVER_USE,
|
||||||
|
Application::instance().config().getString("openSSL.server.privateKeyFile"),
|
||||||
|
Application::instance().config().getString("openSSL.server.privateKeyFile"),
|
||||||
|
Application::instance().config().getString("openSSL.server.caConfig"),
|
||||||
|
Context::VERIFY_NONE,
|
||||||
|
9,
|
||||||
|
true,
|
||||||
|
"ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
||||||
|
pServerContext->enableSessionCache(true, "TestSuite");
|
||||||
|
pServerContext->setSessionTimeout(10);
|
||||||
|
pServerContext->setSessionCacheSize(1000);
|
||||||
|
pServerContext->disableStatelessSessionResumption();
|
||||||
|
|
||||||
|
HTTPSTestServer srv(pServerContext);
|
||||||
|
|
||||||
|
Context::Ptr pClientContext = new Context(
|
||||||
|
Context::CLIENT_USE,
|
||||||
|
Application::instance().config().getString("openSSL.client.privateKeyFile"),
|
||||||
|
Application::instance().config().getString("openSSL.client.privateKeyFile"),
|
||||||
|
Application::instance().config().getString("openSSL.client.caConfig"),
|
||||||
|
Context::VERIFY_RELAXED,
|
||||||
|
9,
|
||||||
|
true,
|
||||||
|
"ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
||||||
|
pClientContext->enableSessionCache(true);
|
||||||
|
|
||||||
|
HTTPSClientSession s1("localhost", srv.port(), pClientContext);
|
||||||
|
HTTPRequest request1(HTTPRequest::HTTP_GET, "/small");
|
||||||
|
s1.sendRequest(request1);
|
||||||
|
Session::Ptr pSession1 = s1.sslSession();
|
||||||
|
HTTPResponse response1;
|
||||||
|
std::istream& rs1 = s1.receiveResponse(response1);
|
||||||
|
assert (response1.getContentLength() == HTTPSTestServer::SMALL_BODY.length());
|
||||||
|
assert (response1.getContentType() == "text/plain");
|
||||||
|
std::ostringstream ostr1;
|
||||||
|
StreamCopier::copyStream(rs1, ostr1);
|
||||||
|
assert (ostr1.str() == HTTPSTestServer::SMALL_BODY);
|
||||||
|
|
||||||
|
HTTPSClientSession s2("localhost", srv.port(), pClientContext, pSession1);
|
||||||
|
HTTPRequest request2(HTTPRequest::HTTP_GET, "/small");
|
||||||
|
s2.sendRequest(request2);
|
||||||
|
Session::Ptr pSession2 = s2.sslSession();
|
||||||
|
HTTPResponse response2;
|
||||||
|
std::istream& rs2 = s2.receiveResponse(response2);
|
||||||
|
assert (response2.getContentLength() == HTTPSTestServer::SMALL_BODY.length());
|
||||||
|
assert (response2.getContentType() == "text/plain");
|
||||||
|
std::ostringstream ostr2;
|
||||||
|
StreamCopier::copyStream(rs2, ostr2);
|
||||||
|
assert (ostr2.str() == HTTPSTestServer::SMALL_BODY);
|
||||||
|
|
||||||
|
assert (pSession1 == pSession2);
|
||||||
|
|
||||||
|
HTTPRequest request3(HTTPRequest::HTTP_GET, "/small");
|
||||||
|
s2.sendRequest(request3);
|
||||||
|
Session::Ptr pSession3 = s2.sslSession();
|
||||||
|
HTTPResponse response3;
|
||||||
|
std::istream& rs3 = s2.receiveResponse(response3);
|
||||||
|
assert (response3.getContentLength() == HTTPSTestServer::SMALL_BODY.length());
|
||||||
|
assert (response3.getContentType() == "text/plain");
|
||||||
|
std::ostringstream ostr3;
|
||||||
|
StreamCopier::copyStream(rs3, ostr3);
|
||||||
|
assert (ostr3.str() == HTTPSTestServer::SMALL_BODY);
|
||||||
|
|
||||||
|
assert (pSession1 == pSession3);
|
||||||
|
|
||||||
|
Thread::sleep(15000); // wait for session to expire
|
||||||
|
pServerContext->flushSessionCache();
|
||||||
|
|
||||||
|
HTTPRequest request4(HTTPRequest::HTTP_GET, "/small");
|
||||||
|
s2.sendRequest(request4);
|
||||||
|
Session::Ptr pSession4 = s2.sslSession();
|
||||||
|
HTTPResponse response4;
|
||||||
|
std::istream& rs4 = s2.receiveResponse(response4);
|
||||||
|
assert (response4.getContentLength() == HTTPSTestServer::SMALL_BODY.length());
|
||||||
|
assert (response4.getContentType() == "text/plain");
|
||||||
|
std::ostringstream ostr4;
|
||||||
|
StreamCopier::copyStream(rs4, ostr4);
|
||||||
|
assert (ostr4.str() == HTTPSTestServer::SMALL_BODY);
|
||||||
|
|
||||||
|
assert (pSession1 != pSession4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void HTTPSClientSessionTest::setUp()
|
void HTTPSClientSessionTest::setUp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -355,9 +456,10 @@ CppUnit::Test* HTTPSClientSessionTest::suite()
|
|||||||
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testPostSmallChunked);
|
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testPostSmallChunked);
|
||||||
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testPostLargeChunked);
|
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testPostLargeChunked);
|
||||||
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testPostLargeChunkedKeepAlive);
|
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testPostLargeChunkedKeepAlive);
|
||||||
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testKeepAlive);
|
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testKeepAlive);
|
||||||
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testInterop);
|
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testInterop);
|
||||||
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testProxy);
|
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testProxy);
|
||||||
|
CppUnit_addTest(pSuite, HTTPSClientSessionTest, testCachedSession);
|
||||||
|
|
||||||
return pSuite;
|
return pSuite;
|
||||||
}
|
}
|
||||||
|
@@ -54,12 +54,13 @@ public:
|
|||||||
void testPostSmallChunked();
|
void testPostSmallChunked();
|
||||||
void testPostLargeChunked();
|
void testPostLargeChunked();
|
||||||
void testPostLargeChunkedKeepAlive();
|
void testPostLargeChunkedKeepAlive();
|
||||||
void testKeepAlive();
|
void testKeepAlive();
|
||||||
void testInterop();
|
void testInterop();
|
||||||
void testProxy();
|
void testProxy();
|
||||||
|
void testCachedSession();
|
||||||
|
|
||||||
void setUp();
|
void setUp();
|
||||||
void tearDown();
|
void tearDown();
|
||||||
|
|
||||||
static CppUnit::Test* suite();
|
static CppUnit::Test* suite();
|
||||||
|
|
||||||
|
@@ -75,11 +75,11 @@ namespace
|
|||||||
|
|
||||||
response.setContentType(request.getContentType());
|
response.setContentType(request.getContentType());
|
||||||
|
|
||||||
std::istream& istr = request.stream();
|
std::istream& istr = request.stream();
|
||||||
std::ostream& ostr = response.send();
|
std::ostream& ostr = response.send();
|
||||||
int n = StreamCopier::copyStream(istr, ostr);
|
StreamCopier::copyStream(istr, ostr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class EchoHeaderRequestHandler: public HTTPRequestHandler
|
class EchoHeaderRequestHandler: public HTTPRequestHandler
|
||||||
{
|
{
|
||||||
|
@@ -35,6 +35,8 @@
|
|||||||
#include "CppUnit/TestSuite.h"
|
#include "CppUnit/TestSuite.h"
|
||||||
#include "Poco/Net/HTTPSStreamFactory.h"
|
#include "Poco/Net/HTTPSStreamFactory.h"
|
||||||
#include "Poco/Net/NetException.h"
|
#include "Poco/Net/NetException.h"
|
||||||
|
#include "Poco/Util/Application.h"
|
||||||
|
#include "Poco/Util/AbstractConfiguration.h"
|
||||||
#include "Poco/URI.h"
|
#include "Poco/URI.h"
|
||||||
#include "Poco/Exception.h"
|
#include "Poco/Exception.h"
|
||||||
#include "Poco/StreamCopier.h"
|
#include "Poco/StreamCopier.h"
|
||||||
@@ -46,6 +48,7 @@
|
|||||||
using Poco::Net::HTTPSStreamFactory;
|
using Poco::Net::HTTPSStreamFactory;
|
||||||
using Poco::Net::NetException;
|
using Poco::Net::NetException;
|
||||||
using Poco::Net::HTTPException;
|
using Poco::Net::HTTPException;
|
||||||
|
using Poco::Util::Application;
|
||||||
using Poco::URI;
|
using Poco::URI;
|
||||||
using Poco::StreamCopier;
|
using Poco::StreamCopier;
|
||||||
|
|
||||||
@@ -101,12 +104,15 @@ void HTTPSStreamFactoryTest::testRedirect()
|
|||||||
|
|
||||||
void HTTPSStreamFactoryTest::testProxy()
|
void HTTPSStreamFactoryTest::testProxy()
|
||||||
{
|
{
|
||||||
HTTPSTestServer server;
|
HTTPSTestServer server;
|
||||||
HTTPSStreamFactory factory("proxy.aon.at", 8080);
|
HTTPSStreamFactory factory(
|
||||||
URI uri("https://sourceforge.net/");
|
Application::instance().config().getString("testsuite.proxy.host"),
|
||||||
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
Application::instance().config().getInt("testsuite.proxy.port")
|
||||||
std::ostringstream ostr;
|
);
|
||||||
StreamCopier::copyStream(*pStr.get(), ostr);
|
URI uri("https://secure.appinf.com/public/poco/NetSSL.txt");
|
||||||
|
std::auto_ptr<std::istream> pStr(factory.open(uri));
|
||||||
|
std::ostringstream ostr;
|
||||||
|
StreamCopier::copyStream(*pStr.get(), ostr);
|
||||||
assert (ostr.str().length() > 0);
|
assert (ostr.str().length() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -61,9 +61,20 @@ HTTPSTestServer::HTTPSTestServer():
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HTTPSTestServer::HTTPSTestServer(Poco::Net::Context::Ptr pContext):
|
||||||
|
_socket(SocketAddress(), 64, pContext),
|
||||||
|
_thread("HTTPSTestServer"),
|
||||||
|
_stop(false)
|
||||||
|
{
|
||||||
|
_thread.start(*this);
|
||||||
|
_ready.wait();
|
||||||
|
_lastRequest.reserve(4000);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HTTPSTestServer::~HTTPSTestServer()
|
HTTPSTestServer::~HTTPSTestServer()
|
||||||
{
|
{
|
||||||
_stop = true;
|
_stop = true;
|
||||||
_thread.join();
|
_thread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// HTTPSTestServer.h
|
// HTTPSTestServer.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/NetSSL_OpenSSL/testsuite/src/HTTPSTestServer.h#7 $
|
// $Id: //poco/1.4/NetSSL_OpenSSL/testsuite/src/HTTPSTestServer.h#1 $
|
||||||
//
|
//
|
||||||
// Definition of the HTTPSTestServer class.
|
// Definition of the HTTPSTestServer class.
|
||||||
//
|
//
|
||||||
@@ -46,11 +46,14 @@ class HTTPSTestServer: public Poco::Runnable
|
|||||||
/// A simple sequential echo server.
|
/// A simple sequential echo server.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HTTPSTestServer();
|
HTTPSTestServer();
|
||||||
/// Creates the HTTPSTestServer.
|
/// Creates the HTTPSTestServer.
|
||||||
|
|
||||||
~HTTPSTestServer();
|
explicit HTTPSTestServer(Poco::Net::Context::Ptr pContext);
|
||||||
/// Destroys the HTTPSTestServer.
|
/// Creates the HTTPSTestServer using the given Context.
|
||||||
|
|
||||||
|
~HTTPSTestServer();
|
||||||
|
/// Destroys the HTTPSTestServer.
|
||||||
|
|
||||||
Poco::UInt16 port() const;
|
Poco::UInt16 port() const;
|
||||||
/// Returns the port the echo server is
|
/// Returns the port the echo server is
|
||||||
|
@@ -39,6 +39,11 @@
|
|||||||
#include "Poco/Net/TCPServerParams.h"
|
#include "Poco/Net/TCPServerParams.h"
|
||||||
#include "Poco/Net/SecureStreamSocket.h"
|
#include "Poco/Net/SecureStreamSocket.h"
|
||||||
#include "Poco/Net/SecureServerSocket.h"
|
#include "Poco/Net/SecureServerSocket.h"
|
||||||
|
#include "Poco/Net/Context.h"
|
||||||
|
#include "Poco/Net/Session.h"
|
||||||
|
#include "Poco/Net/SSLManager.h"
|
||||||
|
#include "Poco/Util/Application.h"
|
||||||
|
#include "Poco/Util/AbstractConfiguration.h"
|
||||||
#include "Poco/Thread.h"
|
#include "Poco/Thread.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
@@ -52,7 +57,11 @@ using Poco::Net::StreamSocket;
|
|||||||
using Poco::Net::SecureStreamSocket;
|
using Poco::Net::SecureStreamSocket;
|
||||||
using Poco::Net::SecureServerSocket;
|
using Poco::Net::SecureServerSocket;
|
||||||
using Poco::Net::SocketAddress;
|
using Poco::Net::SocketAddress;
|
||||||
|
using Poco::Net::Context;
|
||||||
|
using Poco::Net::Session;
|
||||||
|
using Poco::Net::SSLManager;
|
||||||
using Poco::Thread;
|
using Poco::Thread;
|
||||||
|
using Poco::Util::Application;
|
||||||
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
@@ -211,15 +220,19 @@ void TCPServerTest::testMultiConnections()
|
|||||||
|
|
||||||
assert (srv.currentConnections() == 4);
|
assert (srv.currentConnections() == 4);
|
||||||
assert (srv.currentThreads() == 4);
|
assert (srv.currentThreads() == 4);
|
||||||
assert (srv.queuedConnections() == 0);
|
assert (srv.queuedConnections() == 0);
|
||||||
assert (srv.totalConnections() == 4);
|
assert (srv.totalConnections() == 4);
|
||||||
|
|
||||||
SecureStreamSocket ss5(sa);
|
SecureStreamSocket ss5;
|
||||||
Thread::sleep(200);
|
ss5.setLazyHandshake();
|
||||||
assert (srv.queuedConnections() == 1);
|
ss5.connect(sa);
|
||||||
SecureStreamSocket ss6(sa);
|
Thread::sleep(200);
|
||||||
Thread::sleep(200);
|
assert (srv.queuedConnections() == 1);
|
||||||
assert (srv.queuedConnections() == 2);
|
SecureStreamSocket ss6;
|
||||||
|
ss6.setLazyHandshake();
|
||||||
|
ss6.connect(sa);
|
||||||
|
Thread::sleep(200);
|
||||||
|
assert (srv.queuedConnections() == 2);
|
||||||
|
|
||||||
ss1.close();
|
ss1.close();
|
||||||
Thread::sleep(300);
|
Thread::sleep(300);
|
||||||
@@ -249,10 +262,145 @@ void TCPServerTest::testMultiConnections()
|
|||||||
assert (srv.queuedConnections() == 0);
|
assert (srv.queuedConnections() == 0);
|
||||||
assert (srv.totalConnections() == 6);
|
assert (srv.totalConnections() == 6);
|
||||||
|
|
||||||
ss5.close();
|
ss5.close();
|
||||||
ss6.close();
|
ss6.close();
|
||||||
Thread::sleep(300);
|
Thread::sleep(300);
|
||||||
assert (srv.currentConnections() == 0);}
|
assert (srv.currentConnections() == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TCPServerTest::testReuseSocket()
|
||||||
|
{
|
||||||
|
SecureServerSocket svs(0);
|
||||||
|
TCPServer srv(new TCPServerConnectionFactoryImpl<EchoConnection>(), svs);
|
||||||
|
srv.start();
|
||||||
|
assert (srv.currentConnections() == 0);
|
||||||
|
assert (srv.currentThreads() == 0);
|
||||||
|
assert (srv.queuedConnections() == 0);
|
||||||
|
assert (srv.totalConnections() == 0);
|
||||||
|
|
||||||
|
SocketAddress sa("localhost", svs.address().port());
|
||||||
|
SecureStreamSocket ss1(sa);
|
||||||
|
std::string data("hello, world");
|
||||||
|
ss1.sendBytes(data.data(), (int) data.size());
|
||||||
|
char buffer[256];
|
||||||
|
int n = ss1.receiveBytes(buffer, sizeof(buffer));
|
||||||
|
assert (n > 0);
|
||||||
|
assert (std::string(buffer, n) == data);
|
||||||
|
assert (srv.currentConnections() == 1);
|
||||||
|
assert (srv.currentThreads() == 1);
|
||||||
|
assert (srv.queuedConnections() == 0);
|
||||||
|
assert (srv.totalConnections() == 1);
|
||||||
|
ss1.close();
|
||||||
|
Thread::sleep(300);
|
||||||
|
assert (srv.currentConnections() == 0);
|
||||||
|
|
||||||
|
ss1.connect(sa);
|
||||||
|
ss1.sendBytes(data.data(), (int) data.size());
|
||||||
|
n = ss1.receiveBytes(buffer, sizeof(buffer));
|
||||||
|
assert (n > 0);
|
||||||
|
assert (std::string(buffer, n) == data);
|
||||||
|
assert (srv.currentConnections() == 1);
|
||||||
|
assert (srv.queuedConnections() == 0);
|
||||||
|
assert (srv.totalConnections() == 2);
|
||||||
|
ss1.close();
|
||||||
|
Thread::sleep(300);
|
||||||
|
assert (srv.currentConnections() == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TCPServerTest::testReuseSession()
|
||||||
|
{
|
||||||
|
// ensure OpenSSL machinery is fully setup
|
||||||
|
Context::Ptr pDefaultServerContext = SSLManager::instance().defaultServerContext();
|
||||||
|
Context::Ptr pDefaultClientContext = SSLManager::instance().defaultClientContext();
|
||||||
|
|
||||||
|
Context::Ptr pServerContext = new Context(
|
||||||
|
Context::SERVER_USE,
|
||||||
|
Application::instance().config().getString("openSSL.server.privateKeyFile"),
|
||||||
|
Application::instance().config().getString("openSSL.server.privateKeyFile"),
|
||||||
|
Application::instance().config().getString("openSSL.server.caConfig"),
|
||||||
|
Context::VERIFY_NONE,
|
||||||
|
9,
|
||||||
|
true,
|
||||||
|
"ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
||||||
|
pServerContext->enableSessionCache(true, "TestSuite");
|
||||||
|
pServerContext->setSessionTimeout(10);
|
||||||
|
pServerContext->setSessionCacheSize(1000);
|
||||||
|
pServerContext->disableStatelessSessionResumption();
|
||||||
|
|
||||||
|
SecureServerSocket svs(0, 64, pServerContext);
|
||||||
|
TCPServer srv(new TCPServerConnectionFactoryImpl<EchoConnection>(), svs);
|
||||||
|
srv.start();
|
||||||
|
assert (srv.currentConnections() == 0);
|
||||||
|
assert (srv.currentThreads() == 0);
|
||||||
|
assert (srv.queuedConnections() == 0);
|
||||||
|
assert (srv.totalConnections() == 0);
|
||||||
|
|
||||||
|
Context::Ptr pClientContext = new Context(
|
||||||
|
Context::SERVER_USE,
|
||||||
|
Application::instance().config().getString("openSSL.client.privateKeyFile"),
|
||||||
|
Application::instance().config().getString("openSSL.client.privateKeyFile"),
|
||||||
|
Application::instance().config().getString("openSSL.client.caConfig"),
|
||||||
|
Context::VERIFY_RELAXED,
|
||||||
|
9,
|
||||||
|
true,
|
||||||
|
"ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
||||||
|
pClientContext->enableSessionCache(true);
|
||||||
|
|
||||||
|
SocketAddress sa("localhost", svs.address().port());
|
||||||
|
SecureStreamSocket ss1(sa, pClientContext);
|
||||||
|
assert (!ss1.sessionWasReused());
|
||||||
|
std::string data("hello, world");
|
||||||
|
ss1.sendBytes(data.data(), (int) data.size());
|
||||||
|
char buffer[256];
|
||||||
|
int n = ss1.receiveBytes(buffer, sizeof(buffer));
|
||||||
|
assert (n > 0);
|
||||||
|
assert (std::string(buffer, n) == data);
|
||||||
|
assert (srv.currentConnections() == 1);
|
||||||
|
assert (srv.currentThreads() == 1);
|
||||||
|
assert (srv.queuedConnections() == 0);
|
||||||
|
assert (srv.totalConnections() == 1);
|
||||||
|
|
||||||
|
Session::Ptr pSession = ss1.currentSession();
|
||||||
|
|
||||||
|
ss1.close();
|
||||||
|
Thread::sleep(300);
|
||||||
|
assert (srv.currentConnections() == 0);
|
||||||
|
|
||||||
|
ss1.useSession(pSession);
|
||||||
|
ss1.connect(sa);
|
||||||
|
assert (ss1.sessionWasReused());
|
||||||
|
assert (ss1.currentSession() == pSession);
|
||||||
|
ss1.sendBytes(data.data(), (int) data.size());
|
||||||
|
n = ss1.receiveBytes(buffer, sizeof(buffer));
|
||||||
|
assert (n > 0);
|
||||||
|
assert (std::string(buffer, n) == data);
|
||||||
|
assert (srv.currentConnections() == 1);
|
||||||
|
assert (srv.queuedConnections() == 0);
|
||||||
|
assert (srv.totalConnections() == 2);
|
||||||
|
ss1.close();
|
||||||
|
Thread::sleep(300);
|
||||||
|
assert (srv.currentConnections() == 0);
|
||||||
|
|
||||||
|
Thread::sleep(15000); // wait for session to expire
|
||||||
|
pServerContext->flushSessionCache();
|
||||||
|
|
||||||
|
ss1.useSession(pSession);
|
||||||
|
ss1.connect(sa);
|
||||||
|
assert (!ss1.sessionWasReused());
|
||||||
|
assert (ss1.currentSession() != pSession);
|
||||||
|
ss1.sendBytes(data.data(), (int) data.size());
|
||||||
|
n = ss1.receiveBytes(buffer, sizeof(buffer));
|
||||||
|
assert (n > 0);
|
||||||
|
assert (std::string(buffer, n) == data);
|
||||||
|
assert (srv.currentConnections() == 1);
|
||||||
|
assert (srv.queuedConnections() == 0);
|
||||||
|
assert (srv.totalConnections() == 3);
|
||||||
|
ss1.close();
|
||||||
|
Thread::sleep(300);
|
||||||
|
assert (srv.currentConnections() == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void TCPServerTest::setUp()
|
void TCPServerTest::setUp()
|
||||||
@@ -269,9 +417,11 @@ CppUnit::Test* TCPServerTest::suite()
|
|||||||
{
|
{
|
||||||
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TCPServerTest");
|
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TCPServerTest");
|
||||||
|
|
||||||
CppUnit_addTest(pSuite, TCPServerTest, testOneConnection);
|
CppUnit_addTest(pSuite, TCPServerTest, testOneConnection);
|
||||||
CppUnit_addTest(pSuite, TCPServerTest, testTwoConnections);
|
CppUnit_addTest(pSuite, TCPServerTest, testTwoConnections);
|
||||||
CppUnit_addTest(pSuite, TCPServerTest, testMultiConnections);
|
CppUnit_addTest(pSuite, TCPServerTest, testMultiConnections);
|
||||||
|
CppUnit_addTest(pSuite, TCPServerTest, testReuseSocket);
|
||||||
|
CppUnit_addTest(pSuite, TCPServerTest, testReuseSession);
|
||||||
|
|
||||||
return pSuite;
|
return pSuite;
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// TCPServerTest.h
|
// TCPServerTest.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/NetSSL_OpenSSL/testsuite/src/TCPServerTest.h#7 $
|
// $Id: //poco/1.4/NetSSL_OpenSSL/testsuite/src/TCPServerTest.h#1 $
|
||||||
//
|
//
|
||||||
// Definition of the TCPServerTest class.
|
// Definition of the TCPServerTest class.
|
||||||
//
|
//
|
||||||
@@ -46,12 +46,14 @@ public:
|
|||||||
TCPServerTest(const std::string& name);
|
TCPServerTest(const std::string& name);
|
||||||
~TCPServerTest();
|
~TCPServerTest();
|
||||||
|
|
||||||
void testOneConnection();
|
void testOneConnection();
|
||||||
void testTwoConnections();
|
void testTwoConnections();
|
||||||
void testMultiConnections();
|
void testMultiConnections();
|
||||||
|
void testReuseSocket();
|
||||||
|
void testReuseSession();
|
||||||
|
|
||||||
void setUp();
|
void setUp();
|
||||||
void tearDown();
|
void tearDown();
|
||||||
|
|
||||||
static CppUnit::Test* suite();
|
static CppUnit::Test* suite();
|
||||||
|
|
||||||
|
110
NetSSL_OpenSSL/testsuite/src/WinCEDriver.cpp
Normal file
110
NetSSL_OpenSSL/testsuite/src/WinCEDriver.cpp
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
//
|
||||||
|
// WinCEDriver.cpp
|
||||||
|
//
|
||||||
|
// $Id: //poco/1.4/NetSSL_OpenSSL/testsuite/src/WinCEDriver.cpp#1 $
|
||||||
|
//
|
||||||
|
// Console-based test driver for Windows CE.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH.
|
||||||
|
// and Contributors.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
|
// obtaining a copy of the software and accompanying documentation covered by
|
||||||
|
// this license (the "Software") to use, reproduce, display, distribute,
|
||||||
|
// execute, and transmit the Software, and to prepare derivative works of the
|
||||||
|
// Software, and to permit third-parties to whom the Software is furnished to
|
||||||
|
// do so, all subject to the following:
|
||||||
|
//
|
||||||
|
// The copyright notices in the Software and this entire statement, including
|
||||||
|
// the above license grant, this restriction and the following disclaimer,
|
||||||
|
// must be included in all copies of the Software, in whole or in part, and
|
||||||
|
// all derivative works of the Software, unless such copies or derivative
|
||||||
|
// works are solely in the form of machine-executable object code generated by
|
||||||
|
// a source language processor.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||||
|
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||||
|
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||||
|
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#include "CppUnit/TestRunner.h"
|
||||||
|
#include "NetSSLTestSuite.h"
|
||||||
|
#include "Poco/Util/Application.h"
|
||||||
|
#include "Poco/Net/HTTPStreamFactory.h"
|
||||||
|
#include "Poco/Net/HTTPSStreamFactory.h"
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
|
||||||
|
class NetSSLApp: public Poco::Util::Application
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
NetSSLApp()
|
||||||
|
{
|
||||||
|
Poco::Net::initializeSSL();
|
||||||
|
Poco::Net::HTTPStreamFactory::registerFactory();
|
||||||
|
Poco::Net::HTTPSStreamFactory::registerFactory();
|
||||||
|
}
|
||||||
|
|
||||||
|
~NetSSLApp()
|
||||||
|
{
|
||||||
|
Poco::Net::uninitializeSSL();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(const std::vector<std::string>& args)
|
||||||
|
{
|
||||||
|
CppUnit::TestRunner runner;
|
||||||
|
runner.addTest("NetSSLTestSuite", NetSSLTestSuite::suite());
|
||||||
|
return runner.run(_targs) ? 0 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup(const std::vector<std::string>& args)
|
||||||
|
{
|
||||||
|
char* argv[] =
|
||||||
|
{
|
||||||
|
const_cast<char*>(args[0].c_str())
|
||||||
|
};
|
||||||
|
|
||||||
|
init(1, argv);
|
||||||
|
for (std::size_t i = 0; i < args.size(); ++i)
|
||||||
|
_targs.push_back(args[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void initialize(Poco::Util::Application& self)
|
||||||
|
{
|
||||||
|
loadConfiguration(); // load default configuration files, if present
|
||||||
|
Poco::Util::Application::initialize(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<std::string> _targs;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
int _tmain(int argc, wchar_t* argv[])
|
||||||
|
{
|
||||||
|
std::vector<std::string> args;
|
||||||
|
for (int i = 0; i < argc; ++i)
|
||||||
|
{
|
||||||
|
char buffer[1024];
|
||||||
|
std::wcstombs(buffer, argv[i], sizeof(buffer));
|
||||||
|
args.push_back(std::string(buffer));
|
||||||
|
}
|
||||||
|
|
||||||
|
NetSSLApp app;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
app.setup(args);
|
||||||
|
return app.run();
|
||||||
|
}
|
||||||
|
catch (Poco::Exception& exc)
|
||||||
|
{
|
||||||
|
std::cout << exc.displayText() << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// WinDriver.cpp
|
// WinDriver.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/NetSSL_OpenSSL/testsuite/src/WinDriver.cpp#8 $
|
// $Id: //poco/1.4/NetSSL_OpenSSL/testsuite/src/WinDriver.cpp#1 $
|
||||||
//
|
//
|
||||||
// Windows test driver for Poco OpenSSL.
|
// Windows test driver for Poco OpenSSL.
|
||||||
//
|
//
|
||||||
@@ -42,44 +42,55 @@
|
|||||||
class NetSSLApp: public Poco::Util::Application
|
class NetSSLApp: public Poco::Util::Application
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NetSSLApp()
|
NetSSLApp()
|
||||||
{
|
{
|
||||||
}
|
Poco::Net::initializeSSL();
|
||||||
|
Poco::Net::HTTPStreamFactory::registerFactory();
|
||||||
|
Poco::Net::HTTPSStreamFactory::registerFactory();
|
||||||
|
}
|
||||||
|
|
||||||
~NetSSLApp()
|
~NetSSLApp()
|
||||||
{
|
{
|
||||||
}
|
Poco::Net::uninitializeSSL();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(const std::vector<std::string>& args)
|
||||||
|
{
|
||||||
|
CppUnit::WinTestRunner runner;
|
||||||
|
runner.addTest(NetSSLTestSuite::suite());
|
||||||
|
runner.run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initialize(Application& self)
|
void initialize(Poco::Util::Application& self)
|
||||||
{
|
{
|
||||||
loadConfiguration(); // load default configuration files, if present
|
loadConfiguration(); // load default configuration files, if present
|
||||||
Application::initialize(self);
|
Poco::Util::Application::initialize(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<std::string> _targs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class TestDriver: public CppUnit::WinTestRunnerApp
|
class TestDriver: public CppUnit::WinTestRunnerApp
|
||||||
{
|
{
|
||||||
void TestMain()
|
void TestMain()
|
||||||
{
|
{
|
||||||
CppUnit::WinTestRunner runner;
|
NetSSLApp app;
|
||||||
Poco::Net::HTTPStreamFactory::registerFactory();
|
std::string argv("TestSuite");
|
||||||
Poco::Net::HTTPSStreamFactory::registerFactory();
|
const char* pArgv = argv.c_str();
|
||||||
NetSSLApp app;
|
try
|
||||||
std::string argv("OpenSSLTest");
|
{
|
||||||
const char* pArgv = argv.c_str();
|
app.init(1, (char**)&pArgv);
|
||||||
try
|
app.run();
|
||||||
{
|
}
|
||||||
app.init(1, (char**)&pArgv);
|
catch (Poco::Exception& exc)
|
||||||
}
|
{
|
||||||
catch (Poco::Exception& exc)
|
app.logger().log(exc);
|
||||||
{
|
}
|
||||||
app.logger().log(exc);
|
}
|
||||||
}
|
|
||||||
runner.addTest(NetSSLTestSuite::suite());
|
|
||||||
runner.run();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -39,4 +39,10 @@
|
|||||||
</invalidCertificateHandler>
|
</invalidCertificateHandler>
|
||||||
</client>
|
</client>
|
||||||
</openSSL>
|
</openSSL>
|
||||||
|
<testsuite>
|
||||||
|
<proxy>
|
||||||
|
<host>proxy.aon.at</host>
|
||||||
|
<port>8080</port>
|
||||||
|
</proxy>
|
||||||
|
</testsuite>
|
||||||
</AppConfig>
|
</AppConfig>
|
||||||
|
Reference in New Issue
Block a user