fixed line endings

This commit is contained in:
Guenter Obiltschnig
2008-09-19 14:24:17 +00:00
parent 4fe2564846
commit 5f386cfbbf
88 changed files with 8849 additions and 8849 deletions

View File

@@ -1,63 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?eclipse-cdt version="2.0"?> <?eclipse-cdt version="2.0"?>
<cdtproject id="org.eclipse.cdt.make.core.make"> <cdtproject id="org.eclipse.cdt.make.core.make">
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"> <extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser">
<attribute key="addr2line" value="addr2line"/> <attribute key="addr2line" value="addr2line"/>
<attribute key="cygpath" value="cygpath"/> <attribute key="cygpath" value="cygpath"/>
<attribute key="c++filt" value="c++filt"/> <attribute key="c++filt" value="c++filt"/>
<attribute key="nm" value="nm"/> <attribute key="nm" value="nm"/>
</extension> </extension>
<data> <data>
<item id="scannerConfiguration"> <item id="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider> <buildOutputProvider>
<openAction enabled="true" filePath=""/> <openAction enabled="true" filePath=""/>
<parser enabled="true"/> <parser enabled="true"/>
</buildOutputProvider> </buildOutputProvider>
<scannerInfoProvider id="specsFile"> <scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/> <parser enabled="true"/>
</scannerInfoProvider> </scannerInfoProvider>
</profile> </profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider> <buildOutputProvider>
<openAction enabled="false" filePath=""/> <openAction enabled="false" filePath=""/>
<parser enabled="true"/> <parser enabled="true"/>
</buildOutputProvider> </buildOutputProvider>
<scannerInfoProvider id="makefileGenerator"> <scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="false"/> <parser enabled="false"/>
</scannerInfoProvider> </scannerInfoProvider>
</profile> </profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider> <buildOutputProvider>
<openAction enabled="false" filePath=""/> <openAction enabled="false" filePath=""/>
<parser enabled="true"/> <parser enabled="true"/>
</buildOutputProvider> </buildOutputProvider>
<scannerInfoProvider id="specsFile"> <scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="false"/> <parser enabled="false"/>
</scannerInfoProvider> </scannerInfoProvider>
</profile> </profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider> <buildOutputProvider>
<openAction enabled="false" filePath=""/> <openAction enabled="false" filePath=""/>
<parser enabled="true"/> <parser enabled="true"/>
</buildOutputProvider> </buildOutputProvider>
<scannerInfoProvider id="specsFile"> <scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="false"/> <parser enabled="false"/>
</scannerInfoProvider> </scannerInfoProvider>
</profile> </profile>
</item> </item>
<item id="org.eclipse.cdt.core.pathentry"> <item id="org.eclipse.cdt.core.pathentry">
<pathentry excluding="*.vmsbuild|*.sln|*.vcproj|*.ncb|*.suo|*.vcproj.*|include/|src/|testsuite/src/" kind="src" path=""/> <pathentry excluding="*.vmsbuild|*.sln|*.vcproj|*.ncb|*.suo|*.vcproj.*|include/|src/|testsuite/src/" kind="src" path=""/>
<pathentry kind="src" path="include"/> <pathentry kind="src" path="include"/>
<pathentry kind="src" path="src"/> <pathentry kind="src" path="src"/>
<pathentry kind="out" path=""/> <pathentry kind="out" path=""/>
<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/> <pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
</item> </item>
</data> </data>
</cdtproject> </cdtproject>

View File

@@ -1,88 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>Net</name> <name>Net</name>
<comment></comment> <comment></comment>
<projects> <projects>
<project>Foundation</project> <project>Foundation</project>
<project>NetSSL_OpenSSL</project> <project>NetSSL_OpenSSL</project>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand> <buildCommand>
<name>org.eclipse.cdt.make.core.makeBuilder</name> <name>org.eclipse.cdt.make.core.makeBuilder</name>
<triggers>clean,full,incremental,</triggers> <triggers>clean,full,incremental,</triggers>
<arguments> <arguments>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.build.arguments</key> <key>org.eclipse.cdt.make.core.build.arguments</key>
<value></value> <value></value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.core.errorOutputParser</key> <key>org.eclipse.cdt.core.errorOutputParser</key>
<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value> <value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.environment</key> <key>org.eclipse.cdt.make.core.environment</key>
<value></value> <value></value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key> <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value> <value>false</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.build.target.inc</key> <key>org.eclipse.cdt.make.core.build.target.inc</key>
<value>-s</value> <value>-s</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key> <key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value> <value>true</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key> <key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
<value>true</value> <value>true</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.build.location</key> <key>org.eclipse.cdt.make.core.build.location</key>
<value></value> <value></value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.build.command</key> <key>org.eclipse.cdt.make.core.build.command</key>
<value>make</value> <value>make</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.build.target.clean</key> <key>org.eclipse.cdt.make.core.build.target.clean</key>
<value>clean</value> <value>clean</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key> <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value> <value>true</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key> <key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value> <value>true</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key> <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value> <value>true</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.build.target.auto</key> <key>org.eclipse.cdt.make.core.build.target.auto</key>
<value>all</value> <value>all</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key> <key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value> <value>true</value>
</dictionary> </dictionary>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name> <name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.cdt.core.cnature</nature> <nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.make.core.makeNature</nature> <nature>org.eclipse.cdt.make.core.makeNature</nature>
<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature> <nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature> <nature>org.eclipse.cdt.core.ccnature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

View File

@@ -1,40 +1,40 @@
Microsoft Visual Studio Solution File, Format Version 8.00 Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetSSL_OpenSSL", "NetSSL_OpenSSL_vs71.vcproj", "{5AECC55E-A469-11DA-8DA6-005056C00008}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetSSL_OpenSSL", "NetSSL_OpenSSL_vs71.vcproj", "{5AECC55E-A469-11DA-8DA6-005056C00008}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs71.vcproj", "{5B023A89-A469-11DA-8DA6-005056C00008}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs71.vcproj", "{5B023A89-A469-11DA-8DA6-005056C00008}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{5AECC55E-A469-11DA-8DA6-005056C00008} = {5AECC55E-A469-11DA-8DA6-005056C00008} {5AECC55E-A469-11DA-8DA6-005056C00008} = {5AECC55E-A469-11DA-8DA6-005056C00008}
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfiguration) = preSolution
debug_shared = debug_shared debug_shared = debug_shared
debug_static = debug_static debug_static = debug_static
release_shared = release_shared release_shared = release_shared
release_static = release_static release_static = release_static
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution GlobalSection(ProjectConfiguration) = postSolution
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_shared.ActiveCfg = debug_shared|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.debug_shared.ActiveCfg = debug_shared|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_shared.Build.0 = debug_shared|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.debug_shared.Build.0 = debug_shared|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static.ActiveCfg = debug_static|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static.ActiveCfg = debug_static|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static.Build.0 = debug_static|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static.Build.0 = debug_static|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_shared.ActiveCfg = release_shared|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.release_shared.ActiveCfg = release_shared|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_shared.Build.0 = release_shared|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.release_shared.Build.0 = release_shared|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static.ActiveCfg = release_static|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.release_static.ActiveCfg = release_static|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static.Build.0 = release_static|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.release_static.Build.0 = release_static|Win32
{5B023A89-A469-11DA-8DA6-005056C00008}.debug_shared.ActiveCfg = debug_shared|Win32 {5B023A89-A469-11DA-8DA6-005056C00008}.debug_shared.ActiveCfg = debug_shared|Win32
{5B023A89-A469-11DA-8DA6-005056C00008}.debug_shared.Build.0 = debug_shared|Win32 {5B023A89-A469-11DA-8DA6-005056C00008}.debug_shared.Build.0 = debug_shared|Win32
{5B023A89-A469-11DA-8DA6-005056C00008}.debug_static.ActiveCfg = debug_static|Win32 {5B023A89-A469-11DA-8DA6-005056C00008}.debug_static.ActiveCfg = debug_static|Win32
{5B023A89-A469-11DA-8DA6-005056C00008}.debug_static.Build.0 = debug_static|Win32 {5B023A89-A469-11DA-8DA6-005056C00008}.debug_static.Build.0 = debug_static|Win32
{5B023A89-A469-11DA-8DA6-005056C00008}.release_shared.ActiveCfg = release_shared|Win32 {5B023A89-A469-11DA-8DA6-005056C00008}.release_shared.ActiveCfg = release_shared|Win32
{5B023A89-A469-11DA-8DA6-005056C00008}.release_shared.Build.0 = release_shared|Win32 {5B023A89-A469-11DA-8DA6-005056C00008}.release_shared.Build.0 = release_shared|Win32
{5B023A89-A469-11DA-8DA6-005056C00008}.release_static.ActiveCfg = release_static|Win32 {5B023A89-A469-11DA-8DA6-005056C00008}.release_static.ActiveCfg = release_static|Win32
{5B023A89-A469-11DA-8DA6-005056C00008}.release_static.Build.0 = release_static|Win32 {5B023A89-A469-11DA-8DA6-005056C00008}.release_static.Build.0 = release_static|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,39 +1,39 @@
 
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005 # Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetSSL_OpenSSL", "NetSSL_OpenSSL_vs80.vcproj", "{5AECC55E-A469-11DA-8DA6-005056C00008}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetSSL_OpenSSL", "NetSSL_OpenSSL_vs80.vcproj", "{5AECC55E-A469-11DA-8DA6-005056C00008}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs80.vcproj", "{B2B88092-5BCE-4AC0-941E-88167138B4A7}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs80.vcproj", "{B2B88092-5BCE-4AC0-941E-88167138B4A7}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{5AECC55E-A469-11DA-8DA6-005056C00008} = {5AECC55E-A469-11DA-8DA6-005056C00008} {5AECC55E-A469-11DA-8DA6-005056C00008} = {5AECC55E-A469-11DA-8DA6-005056C00008}
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
debug_shared|Win32 = debug_shared|Win32 debug_shared|Win32 = debug_shared|Win32
debug_static|Win32 = debug_static|Win32 debug_static|Win32 = debug_static|Win32
release_shared|Win32 = release_shared|Win32 release_shared|Win32 = release_shared|Win32
release_static|Win32 = release_static|Win32 release_static|Win32 = release_static|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 {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.Build.0 = debug_shared|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static|Win32.ActiveCfg = debug_static|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static|Win32.ActiveCfg = debug_static|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static|Win32.Build.0 = debug_static|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.debug_static|Win32.Build.0 = debug_static|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_shared|Win32.ActiveCfg = release_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.Build.0 = release_shared|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static|Win32.ActiveCfg = release_static|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.release_static|Win32.ActiveCfg = release_static|Win32
{5AECC55E-A469-11DA-8DA6-005056C00008}.release_static|Win32.Build.0 = release_static|Win32 {5AECC55E-A469-11DA-8DA6-005056C00008}.release_static|Win32.Build.0 = release_static|Win32
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_shared|Win32.ActiveCfg = debug_shared|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.Build.0 = debug_shared|Win32
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static|Win32.ActiveCfg = debug_static|Win32 {B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static|Win32.ActiveCfg = debug_static|Win32
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static|Win32.Build.0 = debug_static|Win32 {B2B88092-5BCE-4AC0-941E-88167138B4A7}.debug_static|Win32.Build.0 = debug_static|Win32
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_shared|Win32.ActiveCfg = release_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.Build.0 = release_shared|Win32
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static|Win32.ActiveCfg = release_static|Win32 {B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static|Win32.ActiveCfg = release_static|Win32
{B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static|Win32.Build.0 = release_static|Win32 {B2B88092-5BCE-4AC0-941E-88167138B4A7}.release_static|Win32.Build.0 = release_static|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,36 +1,36 @@
NetSSL requires OpenSSL release 0.9.8 or later. NetSSL requires OpenSSL release 0.9.8 or later.
Unix Unix
==== ====
Most Unix systems already have OpenSSL preinstalled. Most Unix systems already have OpenSSL preinstalled.
If your system does not have OpenSSL, please get it from If your system does not have OpenSSL, please get it from
http://www.openssl.org/ or another source. You do not http://www.openssl.org/ or another source. You do not
have to build OpenSSL yourself - a binary distribution have to build OpenSSL yourself - a binary distribution
is fine. is fine.
If you do build OpenSSl yourself be sure to call If you do build OpenSSl yourself be sure to call
./configure --prefix=/usr --openssldir/usr/openssl ./configure --prefix=/usr --openssldir/usr/openssl
make make
make install (with superuser rights) make install (with superuser rights)
so that poco works out of the box so that poco works out of the box
Windows Windows
======= =======
The easiest way to install OpenSSL on Windows is to The easiest way to install OpenSSL on Windows is to
use a binary (prebuild) release, for example the use a binary (prebuild) release, for example the
one from Shining Light Productions that comes with one from Shining Light Productions that comes with
a Windows installer. a Windows installer.
1. Download OpenSSL (at least v0.98a) from: 1. Download OpenSSL (at least v0.98a) from:
http://www.slproweb.com/products/Win32OpenSSL.html http://www.slproweb.com/products/Win32OpenSSL.html
2. Install OpenSSL (we assume you install to c:\OpenSSL) 2. Install OpenSSL (we assume you install to c:\OpenSSL)
3. Start Visual Studio, go to Tools->Options, under Projects->VC++ Directories 3. Start Visual Studio, go to Tools->Options, under Projects->VC++ Directories
add the following directories: add the following directories:
- Include Files: C:\OpenSSL\include - Include Files: C:\OpenSSL\include
- Library Files: C:\OpenSSL\lib\VC - Library Files: C:\OpenSSL\lib\VC
4. You are now ready to build NetSSL. 4. You are now ready to build NetSSL.

View File

@@ -1,81 +1,81 @@
// //
// AcceptCertificateHandler.h // AcceptCertificateHandler.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/AcceptCertificateHandler.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/AcceptCertificateHandler.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: AcceptCertificateHandler // Module: AcceptCertificateHandler
// //
// Definition of the AcceptCertificateHandler class. // Definition of the AcceptCertificateHandler class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_AcceptCertificateHandler_INCLUDED #ifndef NetSSL_AcceptCertificateHandler_INCLUDED
#define NetSSL_AcceptCertificateHandler_INCLUDED #define NetSSL_AcceptCertificateHandler_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/InvalidCertificateHandler.h" #include "Poco/Net/InvalidCertificateHandler.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API AcceptCertificateHandler: public InvalidCertificateHandler class NetSSL_API AcceptCertificateHandler: public InvalidCertificateHandler
/// A AcceptCertificateHandler is invoked whenever an error /// A AcceptCertificateHandler is invoked whenever an error
/// occurs verifying the certificate. It always accepts /// occurs verifying the certificate. It always accepts
/// the certificate. Only use this one during testing! /// the certificate. Only use this one during testing!
{ {
public: public:
AcceptCertificateHandler(bool handleErrorsOnServerSide); AcceptCertificateHandler(bool handleErrorsOnServerSide);
/// Creates the AcceptCertificateHandler /// Creates the AcceptCertificateHandler
virtual ~AcceptCertificateHandler(); virtual ~AcceptCertificateHandler();
/// Destroys the AcceptCertificateHandler. /// Destroys the AcceptCertificateHandler.
void onInvalidCertificate(const void* pSender, VerificationErrorArgs& errorCert); void onInvalidCertificate(const void* pSender, VerificationErrorArgs& errorCert);
/// Receives the questionable certificate in parameter errorCert. If one wants to accept the /// Receives the questionable certificate in parameter errorCert. If one wants to accept the
/// certificate, call errorCert.setIgnoreError(true). /// certificate, call errorCert.setIgnoreError(true).
}; };
// //
// inlines // inlines
// //
inline void AcceptCertificateHandler::onInvalidCertificate(const void*, VerificationErrorArgs& errorCert) inline void AcceptCertificateHandler::onInvalidCertificate(const void*, VerificationErrorArgs& errorCert)
{ {
errorCert.setIgnoreError(true); errorCert.setIgnoreError(true);
} }
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_AcceptCertificateHandler_INCLUDED #endif // NetSSL_AcceptCertificateHandler_INCLUDED

View File

@@ -1,113 +1,113 @@
// //
// CertificateHandlerFactory.h // CertificateHandlerFactory.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/CertificateHandlerFactory.h#2 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/CertificateHandlerFactory.h#2 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: CertificateHandlerFactory // Module: CertificateHandlerFactory
// //
// Definition of the CertificateHandlerFactory class. // Definition of the CertificateHandlerFactory class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_CertificateHandlerFactory_INCLUDED #ifndef NetSSL_CertificateHandlerFactory_INCLUDED
#define NetSSL_CertificateHandlerFactory_INCLUDED #define NetSSL_CertificateHandlerFactory_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class InvalidCertificateHandler; class InvalidCertificateHandler;
class NetSSL_API CertificateHandlerFactory class NetSSL_API CertificateHandlerFactory
/// A CertificateHandlerFactory is responsible for creating InvalidCertificateHandlers. /// A CertificateHandlerFactory is responsible for creating InvalidCertificateHandlers.
/// You don't need to access this class directly. Use the macro /// You don't need to access this class directly. Use the macro
/// POCO_REGISTER_CHFACTORY(namespace, InvalidCertificateHandlerName) /// POCO_REGISTER_CHFACTORY(namespace, InvalidCertificateHandlerName)
/// instead (see the documentation of InvalidCertificateHandler for an example). /// instead (see the documentation of InvalidCertificateHandler for an example).
{ {
public: public:
CertificateHandlerFactory(); CertificateHandlerFactory();
/// Creates the CertificateHandlerFactory. /// Creates the CertificateHandlerFactory.
virtual ~CertificateHandlerFactory(); virtual ~CertificateHandlerFactory();
/// Destroys the CertificateHandlerFactory. /// Destroys the CertificateHandlerFactory.
virtual InvalidCertificateHandler* create(bool server) const = 0; virtual InvalidCertificateHandler* create(bool server) const = 0;
/// Creates a new InvalidCertificateHandler. Set server to true if the certificate handler is used on the server side. /// Creates a new InvalidCertificateHandler. Set server to true if the certificate handler is used on the server side.
}; };
class NetSSL_API CertificateHandlerFactoryRegistrar class NetSSL_API CertificateHandlerFactoryRegistrar
/// Registrar class which automatically registers CertificateHandlerFactory at the CertificateHandlerFactoryMgr. /// Registrar class which automatically registers CertificateHandlerFactory at the CertificateHandlerFactoryMgr.
/// You don't need to access this class directly. Use the macro /// You don't need to access this class directly. Use the macro
/// POCO_REGISTER_CHFACTORY(namespace, InvalidCertificateHandlerName) /// POCO_REGISTER_CHFACTORY(namespace, InvalidCertificateHandlerName)
/// instead (see the documentation of InvalidCertificateHandler for an example). /// instead (see the documentation of InvalidCertificateHandler for an example).
{ {
public: public:
CertificateHandlerFactoryRegistrar(const std::string& name, CertificateHandlerFactory* pFactory); CertificateHandlerFactoryRegistrar(const std::string& name, CertificateHandlerFactory* pFactory);
/// Registers the CertificateHandlerFactory with the given name at the factory manager. /// Registers the CertificateHandlerFactory with the given name at the factory manager.
virtual ~CertificateHandlerFactoryRegistrar(); virtual ~CertificateHandlerFactoryRegistrar();
/// Destroys the CertificateHandlerFactoryRegistrar. /// Destroys the CertificateHandlerFactoryRegistrar.
}; };
template <typename T> template <typename T>
class CertificateHandlerFactoryImpl: public Poco::Net::CertificateHandlerFactory class CertificateHandlerFactoryImpl: public Poco::Net::CertificateHandlerFactory
{ {
public: public:
CertificateHandlerFactoryImpl() CertificateHandlerFactoryImpl()
{ {
} }
~CertificateHandlerFactoryImpl() ~CertificateHandlerFactoryImpl()
{ {
} }
InvalidCertificateHandler* create(bool server) const InvalidCertificateHandler* create(bool server) const
{ {
return new T(server); return new T(server);
} }
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
// DEPRECATED: register the factory directly at the FactoryMgr: // DEPRECATED: register the factory directly at the FactoryMgr:
// Poco::Net::SSLManager::instance().certificateHandlerFactoryMgr().setFactory(name, new Poco::Net::CertificateHandlerFactoryImpl<MyConsoleHandler>()); // Poco::Net::SSLManager::instance().certificateHandlerFactoryMgr().setFactory(name, new Poco::Net::CertificateHandlerFactoryImpl<MyConsoleHandler>());
#define POCO_REGISTER_CHFACTORY(API, PKCLS) \ #define POCO_REGISTER_CHFACTORY(API, PKCLS) \
static Poco::Net::CertificateHandlerFactoryRegistrar aRegistrar(std::string(#PKCLS), new Poco::Net::CertificateHandlerFactoryImpl<PKCLS>()); static Poco::Net::CertificateHandlerFactoryRegistrar aRegistrar(std::string(#PKCLS), new Poco::Net::CertificateHandlerFactoryImpl<PKCLS>());
#endif // NetSSL_CertificateHandlerFactory_INCLUDED #endif // NetSSL_CertificateHandlerFactory_INCLUDED

View File

@@ -1,86 +1,86 @@
// //
// CertificateHandlerFactoryMgr.h // CertificateHandlerFactoryMgr.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/CertificateHandlerFactoryMgr.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/CertificateHandlerFactoryMgr.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: CertificateHandlerFactoryMgr // Module: CertificateHandlerFactoryMgr
// //
// Definition of the CertificateHandlerFactoryMgr class. // Definition of the CertificateHandlerFactoryMgr class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_CertificateHandlerFactoryMgr_INCLUDED #ifndef NetSSL_CertificateHandlerFactoryMgr_INCLUDED
#define NetSSL_CertificateHandlerFactoryMgr_INCLUDED #define NetSSL_CertificateHandlerFactoryMgr_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/CertificateHandlerFactory.h" #include "Poco/Net/CertificateHandlerFactory.h"
#include "Poco/SharedPtr.h" #include "Poco/SharedPtr.h"
#include <map> #include <map>
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API CertificateHandlerFactoryMgr class NetSSL_API CertificateHandlerFactoryMgr
/// A CertificateHandlerFactoryMgr manages all existing CertificateHandlerFactories. /// A CertificateHandlerFactoryMgr manages all existing CertificateHandlerFactories.
{ {
public: public:
typedef std::map<std::string, Poco::SharedPtr<CertificateHandlerFactory> > FactoriesMap; typedef std::map<std::string, Poco::SharedPtr<CertificateHandlerFactory> > FactoriesMap;
CertificateHandlerFactoryMgr(); CertificateHandlerFactoryMgr();
/// Creates the CertificateHandlerFactoryMgr. /// Creates the CertificateHandlerFactoryMgr.
~CertificateHandlerFactoryMgr(); ~CertificateHandlerFactoryMgr();
/// Destroys the CertificateHandlerFactoryMgr. /// Destroys the CertificateHandlerFactoryMgr.
void setFactory(const std::string& name, CertificateHandlerFactory* pFactory); void setFactory(const std::string& name, CertificateHandlerFactory* pFactory);
/// Registers the factory. Class takes ownership of the pointer. /// Registers the factory. Class takes ownership of the pointer.
/// If a factory with the same name already exists, an exception is thrown. /// If a factory with the same name already exists, an exception is thrown.
bool hasFactory(const std::string& name) const; bool hasFactory(const std::string& name) const;
/// Returns true if for the given name a factory is already registered /// Returns true if for the given name a factory is already registered
const CertificateHandlerFactory* getFactory(const std::string& name) const; const CertificateHandlerFactory* getFactory(const std::string& name) const;
/// Returns NULL if for the given name a factory does not exist, otherwise the factory is returned /// Returns NULL if for the given name a factory does not exist, otherwise the factory is returned
void removeFactory(const std::string& name); void removeFactory(const std::string& name);
/// Removes the factory from the manager. /// Removes the factory from the manager.
private: private:
FactoriesMap _factories; FactoriesMap _factories;
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_CertificateHandlerFactoryMgr_INCLUDED #endif // NetSSL_CertificateHandlerFactoryMgr_INCLUDED

View File

@@ -1,71 +1,71 @@
// //
// ConsoleCertificateHandler.h // ConsoleCertificateHandler.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/ConsoleCertificateHandler.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/ConsoleCertificateHandler.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: ConsoleCertificateHandler // Module: ConsoleCertificateHandler
// //
// Definition of the ConsoleCertificateHandler class. // Definition of the ConsoleCertificateHandler class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_ConsoleCertificateHandler_INCLUDED #ifndef NetSSL_ConsoleCertificateHandler_INCLUDED
#define NetSSL_ConsoleCertificateHandler_INCLUDED #define NetSSL_ConsoleCertificateHandler_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/InvalidCertificateHandler.h" #include "Poco/Net/InvalidCertificateHandler.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API ConsoleCertificateHandler: public InvalidCertificateHandler class NetSSL_API ConsoleCertificateHandler: public InvalidCertificateHandler
/// A ConsoleCertificateHandler is invoked whenever an error occurs verifying the certificate. /// A ConsoleCertificateHandler is invoked whenever an error occurs verifying the certificate.
/// The certificate is printed to stdout and the user is asked via console if he wants to accept it. /// The certificate is printed to stdout and the user is asked via console if he wants to accept it.
{ {
public: public:
ConsoleCertificateHandler(bool handleErrorsOnServerSide); ConsoleCertificateHandler(bool handleErrorsOnServerSide);
/// Creates the ConsoleCertificateHandler. /// Creates the ConsoleCertificateHandler.
virtual ~ConsoleCertificateHandler(); virtual ~ConsoleCertificateHandler();
/// Destroys the ConsoleCertificateHandler. /// Destroys the ConsoleCertificateHandler.
void onInvalidCertificate(const void* pSender, VerificationErrorArgs& errorCert); void onInvalidCertificate(const void* pSender, VerificationErrorArgs& errorCert);
/// Prints the certificate to stdout and waits for user input on the console /// Prints the certificate to stdout and waits for user input on the console
/// to decide if a certificate should be accepted/rejected. /// to decide if a certificate should be accepted/rejected.
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_ConsoleCertificateHandler_INCLUDED #endif // NetSSL_ConsoleCertificateHandler_INCLUDED

View File

@@ -1,112 +1,112 @@
// //
// HTTPSClientSession.h // HTTPSClientSession.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/HTTPSClientSession.h#3 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/HTTPSClientSession.h#3 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: HTTPSClient // Package: HTTPSClient
// Module: HTTPSClientSession // Module: HTTPSClientSession
// //
// Definition of the HTTPSClientSession class. // Definition of the HTTPSClientSession class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_HTTPSClientSession_INCLUDED #ifndef NetSSL_HTTPSClientSession_INCLUDED
#define NetSSL_HTTPSClientSession_INCLUDED #define NetSSL_HTTPSClientSession_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/Utility.h" #include "Poco/Net/Utility.h"
#include "Poco/Net/HTTPClientSession.h" #include "Poco/Net/HTTPClientSession.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class SecureStreamSocket; class SecureStreamSocket;
class HTTPRequest; class HTTPRequest;
class HTTPResponse; class HTTPResponse;
class NetSSL_API HTTPSClientSession: public HTTPClientSession class NetSSL_API HTTPSClientSession: public HTTPClientSession
/// This class implements the client-side of /// This class implements the client-side of
/// a HTTPS session. /// a HTTPS session.
/// ///
/// To send a HTTPS request to a HTTPS server, first /// To send a HTTPS request to a HTTPS server, first
/// instantiate a HTTPSClientSession object and /// instantiate a HTTPSClientSession object and
/// specify the server's host name and port number. /// specify the server's host name and port number.
/// ///
/// Then create a HTTPRequest object, fill it accordingly, /// Then create a HTTPRequest object, fill it accordingly,
/// and pass it as argument to the sendRequst() method. /// and pass it as argument to the sendRequst() method.
/// ///
/// sendRequest() will return an output stream that can /// sendRequest() will return an output stream that can
/// be used to send the request body, if there is any. /// be used to send the request body, if there is any.
/// ///
/// After you are done sending the request body, create /// After you are done sending the request body, create
/// a HTTPResponse object and pass it to receiveResponse(). /// a HTTPResponse object and pass it to receiveResponse().
/// ///
/// This will return an input stream that can be used to /// This will return an input stream that can be used to
/// read the response body. /// read the response body.
/// ///
/// See RFC 2616 <http://www.faqs.org/rfcs/rfc2616.html> for more /// See RFC 2616 <http://www.faqs.org/rfcs/rfc2616.html> for more
/// information about the HTTP protocol. /// information about the HTTP protocol.
{ {
public: public:
HTTPSClientSession(); HTTPSClientSession();
/// Creates an unconnected HTTPSClientSession. /// Creates an unconnected HTTPSClientSession.
HTTPSClientSession(const SecureStreamSocket& socket); 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 = Utility::HTTPS_PORT); HTTPSClientSession(const std::string& host, Poco::UInt16 port = Utility::HTTPS_PORT);
/// Creates a HTTPSClientSession using the given host and port. /// Creates a HTTPSClientSession using the given host and port.
~HTTPSClientSession(); ~HTTPSClientSession();
/// Destroys the HTTPSClientSession and closes /// Destroys the HTTPSClientSession and closes
/// the underlying socket. /// the underlying socket.
protected: protected:
void connect(const SocketAddress& address); void connect(const SocketAddress& address);
// Connects the socket to the server. // Connects the socket to the server.
std::string getHostInfo() const; std::string getHostInfo() const;
/// Returns the target host and port number for proxy requests. /// Returns the target host and port number for proxy requests.
private: private:
HTTPSClientSession(const HTTPSClientSession&); HTTPSClientSession(const HTTPSClientSession&);
HTTPSClientSession& operator = (const HTTPSClientSession&); HTTPSClientSession& operator = (const HTTPSClientSession&);
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // Net_HTTPSClientSession_INCLUDED #endif // Net_HTTPSClientSession_INCLUDED

View File

@@ -1,77 +1,77 @@
// //
// HTTPSSessionInstantiator.h // HTTPSSessionInstantiator.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/HTTPSSessionInstantiator.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/HTTPSSessionInstantiator.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: HTTPSClient // Package: HTTPSClient
// Module: HTTPSSessionInstantiator // Module: HTTPSSessionInstantiator
// //
// Definition of the HTTPSSessionInstantiator class. // Definition of the HTTPSSessionInstantiator class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef Net_HTTPSSessionInstantiator_INCLUDED #ifndef Net_HTTPSSessionInstantiator_INCLUDED
#define Net_HTTPSSessionInstantiator_INCLUDED #define Net_HTTPSSessionInstantiator_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/Utility.h" #include "Poco/Net/Utility.h"
#include "Poco/Net/HTTPSessionInstantiator.h" #include "Poco/Net/HTTPSessionInstantiator.h"
#include "Poco/URI.h" #include "Poco/URI.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API HTTPSSessionInstantiator: public HTTPSessionInstantiator class NetSSL_API HTTPSSessionInstantiator: public HTTPSessionInstantiator
/// The HTTPSessionInstantiator for HTTPSClientSession. /// The HTTPSessionInstantiator for HTTPSClientSession.
{ {
public: public:
HTTPSSessionInstantiator(); HTTPSSessionInstantiator();
/// Creates the HTTPSSessionInstantiator. /// Creates the HTTPSSessionInstantiator.
~HTTPSSessionInstantiator(); ~HTTPSSessionInstantiator();
/// Destroys the HTTPSSessionInstantiator. /// Destroys the HTTPSSessionInstantiator.
HTTPClientSession* createClientSession(const Poco::URI& uri); HTTPClientSession* createClientSession(const Poco::URI& uri);
/// Creates a HTTPSClientSession for the given URI. /// Creates a HTTPSClientSession for the given URI.
static void registerInstantiator(); static void registerInstantiator();
/// Registers the instantiator with the global HTTPSessionFactory. /// Registers the instantiator with the global HTTPSessionFactory.
static void unregisterInstantiator(); static void unregisterInstantiator();
/// Unregisters the factory with the global HTTPSessionFactory. /// Unregisters the factory with the global HTTPSessionFactory.
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // Net_HTTPSSessionInstantiator_INCLUDED #endif // Net_HTTPSSessionInstantiator_INCLUDED

View File

@@ -1,92 +1,92 @@
// //
// HTTPSStreamFactory.h // HTTPSStreamFactory.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/HTTPSStreamFactory.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/HTTPSStreamFactory.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: HTTPSClient // Package: HTTPSClient
// Module: HTTPSStreamFactory // Module: HTTPSStreamFactory
// //
// Definition of the HTTPSStreamFactory class. // Definition of the HTTPSStreamFactory class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_HTTPSStreamFactory_INCLUDED #ifndef NetSSL_HTTPSStreamFactory_INCLUDED
#define NetSSL_HTTPSStreamFactory_INCLUDED #define NetSSL_HTTPSStreamFactory_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/HTTPSession.h" #include "Poco/Net/HTTPSession.h"
#include "Poco/URIStreamFactory.h" #include "Poco/URIStreamFactory.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API HTTPSStreamFactory: public Poco::URIStreamFactory class NetSSL_API HTTPSStreamFactory: public Poco::URIStreamFactory
/// An implementation of the URIStreamFactory interface /// An implementation of the URIStreamFactory interface
/// that handles Hyper-Text Transfer Protocol (http) URIs. /// that handles Hyper-Text Transfer Protocol (http) URIs.
{ {
public: 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. /// HTTP connections will use the given proxy.
~HTTPSStreamFactory(); ~HTTPSStreamFactory();
/// Destroys the 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.
/// The URI must be a https://... URI. /// The URI must be a https://... URI.
/// ///
/// Throws a NetException if anything goes wrong. /// Throws a NetException if anything goes wrong.
static void registerFactory(); static void registerFactory();
/// Registers the HTTPSStreamFactory with the /// Registers the HTTPSStreamFactory with the
/// default URIStreamOpener instance. /// default URIStreamOpener instance.
private: private:
enum enum
{ {
MAX_REDIRECTS = 10 MAX_REDIRECTS = 10
}; };
std::string _proxyHost; std::string _proxyHost;
Poco::UInt16 _proxyPort; Poco::UInt16 _proxyPort;
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // Net_HTTPSStreamFactory_INCLUDED #endif // Net_HTTPSStreamFactory_INCLUDED

View File

@@ -1,100 +1,100 @@
// //
// InvalidCertificateHandler.h // InvalidCertificateHandler.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/InvalidCertificateHandler.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/InvalidCertificateHandler.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: InvalidCertificateHandler // Module: InvalidCertificateHandler
// //
// Definition of the InvalidCertificateHandler class. // Definition of the InvalidCertificateHandler class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_InvalidCertificateHandler_INCLUDED #ifndef NetSSL_InvalidCertificateHandler_INCLUDED
#define NetSSL_InvalidCertificateHandler_INCLUDED #define NetSSL_InvalidCertificateHandler_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/VerificationErrorArgs.h" #include "Poco/Net/VerificationErrorArgs.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API InvalidCertificateHandler class NetSSL_API InvalidCertificateHandler
/// A InvalidCertificateHandler is invoked whenever an error occurs verifying the certificate. It allows the user /// A InvalidCertificateHandler is invoked whenever an error occurs verifying the certificate. It allows the user
/// to inspect and accept/reject the certificate. /// to inspect and accept/reject the certificate.
/// One can install one's own InvalidCertificateHandler by implementing this interface. Note that /// One can install one's own InvalidCertificateHandler by implementing this interface. Note that
/// in the cpp file of the subclass the following code must be present (assuming you use the namespace My_API /// in the cpp file of the subclass the following code must be present (assuming you use the namespace My_API
/// and the name of your handler class is MyGuiHandler): /// and the name of your handler class is MyGuiHandler):
/// ///
/// #include "Poco/Net/CertificateHandlerFactory.h" /// #include "Poco/Net/CertificateHandlerFactory.h"
/// ... /// ...
/// POCO_REGISTER_CHFACTORY(My_API, MyGuiHandler) /// POCO_REGISTER_CHFACTORY(My_API, MyGuiHandler)
/// ///
/// One can either set the handler directly in the startup code of the main method of ones application by calling /// One can either set the handler directly in the startup code of the main method of ones application by calling
/// ///
/// SSLManager::instance().initialize(mypassphraseHandler, myguiHandler, mySSLContext) /// SSLManager::instance().initialize(mypassphraseHandler, myguiHandler, mySSLContext)
/// ///
/// or in case one uses Poco::Util::Application one can rely on an XML configuration and put the following entry /// or in case one uses Poco::Util::Application one can rely on an XML configuration and put the following entry
/// under the path openSSL.invalidCertificateHandler: /// under the path openSSL.invalidCertificateHandler:
/// ///
/// <invalidCertificateHandler> /// <invalidCertificateHandler>
/// <name>MyGuiHandler<name> /// <name>MyGuiHandler<name>
/// <options> /// <options>
/// [...] // Put optional config params for the handler here /// [...] // Put optional config params for the handler here
/// </options> /// </options>
/// </invalidCertificateHandler> /// </invalidCertificateHandler>
/// Note that the name of the InvalidCertificateHandler must be same as the one provided to the POCO_REGISTER_CHFACTORY macro. /// Note that the name of the InvalidCertificateHandler must be same as the one provided to the POCO_REGISTER_CHFACTORY macro.
{ {
public: public:
InvalidCertificateHandler(bool handleErrorsOnServerSide); InvalidCertificateHandler(bool handleErrorsOnServerSide);
/// Creates the InvalidCertificateHandler. /// Creates the InvalidCertificateHandler.
/// Set handleErrorsOnServerSide to true if the certificate handler is used on the server side. /// Set handleErrorsOnServerSide to true if the certificate handler is used on the server side.
/// Automatically registers at one of the SSLManager::VerificationError events. /// Automatically registers at one of the SSLManager::VerificationError events.
virtual ~InvalidCertificateHandler(); virtual ~InvalidCertificateHandler();
/// Destroys the InvalidCertificateHandler. /// Destroys the InvalidCertificateHandler.
virtual void onInvalidCertificate(const void* pSender, VerificationErrorArgs& errorCert) = 0; virtual void onInvalidCertificate(const void* pSender, VerificationErrorArgs& errorCert) = 0;
/// Receives the questionable certificate in parameter errorCert. If one wants to accept the /// Receives the questionable certificate in parameter errorCert. If one wants to accept the
/// certificate, call errorCert.setIgnoreError(true). /// certificate, call errorCert.setIgnoreError(true).
protected: protected:
bool _handleErrorsOnServerSide; bool _handleErrorsOnServerSide;
/// Stores if the certificate handler gets invoked by the server (i.e. a client certificate is wrong) /// Stores if the certificate handler gets invoked by the server (i.e. a client certificate is wrong)
/// or the client (a server certificate is wrong) /// or the client (a server certificate is wrong)
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_InvalidCertificateHandler_INCLUDED #endif // NetSSL_InvalidCertificateHandler_INCLUDED

View File

@@ -1,68 +1,68 @@
// //
// KeyConsoleHandler.h // KeyConsoleHandler.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/KeyConsoleHandler.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/KeyConsoleHandler.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: KeyConsoleHandler // Module: KeyConsoleHandler
// //
// Definition of the KeyConsoleHandler class. // Definition of the KeyConsoleHandler class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_KeyConsoleHandler_INCLUDED #ifndef NetSSL_KeyConsoleHandler_INCLUDED
#define NetSSL_KeyConsoleHandler_INCLUDED #define NetSSL_KeyConsoleHandler_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/PrivateKeyPassphraseHandler.h" #include "Poco/Net/PrivateKeyPassphraseHandler.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API KeyConsoleHandler: public PrivateKeyPassphraseHandler class NetSSL_API KeyConsoleHandler: public PrivateKeyPassphraseHandler
/// Class KeyConsoleHandler. Reads the key for a certificate from the console. /// Class KeyConsoleHandler. Reads the key for a certificate from the console.
{ {
public: public:
KeyConsoleHandler(bool server); KeyConsoleHandler(bool server);
/// Creates the KeyConsoleHandler. /// Creates the KeyConsoleHandler.
~KeyConsoleHandler(); ~KeyConsoleHandler();
/// Destroys the KeyConsoleHandler. /// Destroys the KeyConsoleHandler.
void onPrivateKeyRequested(const void* pSender, std::string& privateKey); void onPrivateKeyRequested(const void* pSender, std::string& privateKey);
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_KeyConsoleHandler_INCLUDED #endif // NetSSL_KeyConsoleHandler_INCLUDED

View File

@@ -1,72 +1,72 @@
// //
// KeyFileHandler.h // KeyFileHandler.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/KeyFileHandler.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/KeyFileHandler.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: KeyFileHandler // Module: KeyFileHandler
// //
// Definition of the KeyFileHandler class. // Definition of the KeyFileHandler class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_KeyFileHandler_INCLUDED #ifndef NetSSL_KeyFileHandler_INCLUDED
#define NetSSL_KeyFileHandler_INCLUDED #define NetSSL_KeyFileHandler_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/PrivateKeyPassphraseHandler.h" #include "Poco/Net/PrivateKeyPassphraseHandler.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API KeyFileHandler: public PrivateKeyPassphraseHandler class NetSSL_API KeyFileHandler: public PrivateKeyPassphraseHandler
/// Class KeyFileHandler. Reads the key for a certificate from a configuration file /// Class KeyFileHandler. Reads the key for a certificate from a configuration file
/// under the path "openSSL.privateKeyPassphraseHandler.options.password". /// under the path "openSSL.privateKeyPassphraseHandler.options.password".
{ {
public: public:
KeyFileHandler(bool server); KeyFileHandler(bool server);
/// Creates the KeyFileHandler. /// Creates the KeyFileHandler.
virtual ~KeyFileHandler(); virtual ~KeyFileHandler();
/// Destroys the KeyFileHandler. /// Destroys the KeyFileHandler.
void onPrivateKeyRequested(const void* pSender, std::string& privateKey); void onPrivateKeyRequested(const void* pSender, std::string& privateKey);
private: private:
static const std::string CFG_PRIV_KEY_FILE; static const std::string CFG_PRIV_KEY_FILE;
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_KeyFileHandler_INCLUDED #endif // NetSSL_KeyFileHandler_INCLUDED

View File

@@ -1,92 +1,92 @@
// //
// NetSSL.h // NetSSL.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/NetSSL.h#2 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/NetSSL.h#2 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: OpenSSL // Module: OpenSSL
// //
// Basic definitions for the Poco OpenSSL library. // Basic definitions for the Poco OpenSSL library.
// This file must be the first file included by every other OpenSSL // This file must be the first file included by every other OpenSSL
// header file. // header file.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_NetSSL_INCLUDED #ifndef NetSSL_NetSSL_INCLUDED
#define NetSSL_NetSSL_INCLUDED #define NetSSL_NetSSL_INCLUDED
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
// //
// The following block is the standard way of creating macros which make exporting // The following block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the NetSSL_EXPORTS // from a DLL simpler. All files within this DLL are compiled with the NetSSL_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project // symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see // that uses this DLL. This way any other project whose source files include this file see
// NetSSL_API functions as being imported from a DLL, wheras this DLL sees symbols // NetSSL_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported. // defined with this macro as being exported.
// //
#if (defined(_WIN32) || defined(__CYGWIN__)) && defined(POCO_DLL) #if (defined(_WIN32) || defined(__CYGWIN__)) && defined(POCO_DLL)
#if defined(NetSSL_EXPORTS) #if defined(NetSSL_EXPORTS)
#define NetSSL_API __declspec(dllexport) #define NetSSL_API __declspec(dllexport)
#else #else
#define NetSSL_API __declspec(dllimport) #define NetSSL_API __declspec(dllimport)
#endif #endif
#endif #endif
#if !defined(NetSSL_API) #if !defined(NetSSL_API)
#define NetSSL_API #define NetSSL_API
#endif #endif
// //
// 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) #if defined(POCO_DLL)
#if defined(_DEBUG) #if defined(_DEBUG)
#pragma comment(lib, "PocoNetSSLd.lib") #pragma comment(lib, "PocoNetSSLd.lib")
#else #else
#pragma comment(lib, "PocoNetSSL.lib") #pragma comment(lib, "PocoNetSSL.lib")
#endif #endif
#else #else
#if defined(_DEBUG) #if defined(_DEBUG)
#pragma comment(lib, "PocoNetSSLmtd.lib") #pragma comment(lib, "PocoNetSSLmtd.lib")
#else #else
#pragma comment(lib, "PocoNetSSLmt.lib") #pragma comment(lib, "PocoNetSSLmt.lib")
#endif #endif
#endif #endif
#endif #endif
#endif #endif
#endif // NetSSL_NetSSL_INCLUDED #endif // NetSSL_NetSSL_INCLUDED

View File

@@ -1,115 +1,115 @@
// //
// PrivateKeyFactory.h // PrivateKeyFactory.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/PrivateKeyFactory.h#2 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/PrivateKeyFactory.h#2 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: PrivateKeyFactory // Module: PrivateKeyFactory
// //
// Definition of the PrivateKeyFactory class. // Definition of the PrivateKeyFactory class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_PrivateKeyFactory_INCLUDED #ifndef NetSSL_PrivateKeyFactory_INCLUDED
#define NetSSL_PrivateKeyFactory_INCLUDED #define NetSSL_PrivateKeyFactory_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class PrivateKeyPassphraseHandler; class PrivateKeyPassphraseHandler;
class NetSSL_API PrivateKeyFactory class NetSSL_API PrivateKeyFactory
/// A PrivateKeyFactory is responsible for creating PrivateKeyPassphraseHandlers. /// A PrivateKeyFactory is responsible for creating PrivateKeyPassphraseHandlers.
/// You don't need to access this class directly. Use the macro /// You don't need to access this class directly. Use the macro
/// POCO_REGISTER_KEYFACTORY(namespace, PrivateKeyPassphraseHandlerName) /// POCO_REGISTER_KEYFACTORY(namespace, PrivateKeyPassphraseHandlerName)
/// instead (see the documentation of PrivateKeyPassphraseHandler for an example). /// instead (see the documentation of PrivateKeyPassphraseHandler for an example).
{ {
public: public:
PrivateKeyFactory(); PrivateKeyFactory();
/// Creates the PrivateKeyFactory. /// Creates the PrivateKeyFactory.
virtual ~PrivateKeyFactory(); virtual ~PrivateKeyFactory();
/// Destroys the PrivateKeyFactory. /// Destroys the PrivateKeyFactory.
virtual PrivateKeyPassphraseHandler* create(bool onServer) const = 0; virtual PrivateKeyPassphraseHandler* create(bool onServer) const = 0;
/// Creates a new PrivateKeyPassphraseHandler /// Creates a new PrivateKeyPassphraseHandler
}; };
class NetSSL_API PrivateKeyFactoryRegistrar class NetSSL_API PrivateKeyFactoryRegistrar
/// Registrar class which automatically registers PrivateKeyFactories at the PrivateKeyFactoryMgr. /// Registrar class which automatically registers PrivateKeyFactories at the PrivateKeyFactoryMgr.
/// You don't need to access this class directly. Use the macro /// You don't need to access this class directly. Use the macro
/// POCO_REGISTER_KEYFACTORY(namespace, PrivateKeyPassphraseHandlerName) /// POCO_REGISTER_KEYFACTORY(namespace, PrivateKeyPassphraseHandlerName)
/// instead (see the documentation of PrivateKeyPassphraseHandler for an example). /// instead (see the documentation of PrivateKeyPassphraseHandler for an example).
{ {
public: public:
PrivateKeyFactoryRegistrar(const std::string& name, PrivateKeyFactory* pFactory); PrivateKeyFactoryRegistrar(const std::string& name, PrivateKeyFactory* pFactory);
/// Registers the PrivateKeyFactory with the given name at the factory manager. /// Registers the PrivateKeyFactory with the given name at the factory manager.
virtual ~PrivateKeyFactoryRegistrar(); virtual ~PrivateKeyFactoryRegistrar();
/// Destroys the PrivateKeyFactoryRegistrar. /// Destroys the PrivateKeyFactoryRegistrar.
}; };
template<typename T> template<typename T>
class PrivateKeyFactoryImpl: public Poco::Net::PrivateKeyFactory class PrivateKeyFactoryImpl: public Poco::Net::PrivateKeyFactory
{ {
public: public:
PrivateKeyFactoryImpl() PrivateKeyFactoryImpl()
{ {
} }
~PrivateKeyFactoryImpl() ~PrivateKeyFactoryImpl()
{ {
} }
PrivateKeyPassphraseHandler* create(bool server) const PrivateKeyPassphraseHandler* create(bool server) const
{ {
return new T(server); return new T(server);
} }
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
// DEPRECATED: register the factory directly at the FactoryMgr: // DEPRECATED: register the factory directly at the FactoryMgr:
// Poco::Net::SSLManager::instance().privateKeyFactoryMgr().setFactory(name, new Poco::Net::PrivateKeyFactoryImpl<MyKeyHandler>()); // Poco::Net::SSLManager::instance().privateKeyFactoryMgr().setFactory(name, new Poco::Net::PrivateKeyFactoryImpl<MyKeyHandler>());
#define POCO_REGISTER_KEYFACTORY(API, PKCLS) \ #define POCO_REGISTER_KEYFACTORY(API, PKCLS) \
static Poco::Net::PrivateKeyFactoryRegistrar aRegistrar(std::string(#PKCLS), new Poco::Net::PrivateKeyFactoryImpl<PKCLS>()); static Poco::Net::PrivateKeyFactoryRegistrar aRegistrar(std::string(#PKCLS), new Poco::Net::PrivateKeyFactoryImpl<PKCLS>());
#endif // NetSSL_PrivateKeyFactory_INCLUDED #endif // NetSSL_PrivateKeyFactory_INCLUDED

View File

@@ -1,86 +1,86 @@
// //
// PrivateKeyFactoryMgr.h // PrivateKeyFactoryMgr.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/PrivateKeyFactoryMgr.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/PrivateKeyFactoryMgr.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: PrivateKeyFactoryMgr // Module: PrivateKeyFactoryMgr
// //
// Definition of the PrivateKeyFactoryMgr class. // Definition of the PrivateKeyFactoryMgr class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_PrivateKeyFactoryMgr_INCLUDED #ifndef NetSSL_PrivateKeyFactoryMgr_INCLUDED
#define NetSSL_PrivateKeyFactoryMgr_INCLUDED #define NetSSL_PrivateKeyFactoryMgr_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/PrivateKeyFactory.h" #include "Poco/Net/PrivateKeyFactory.h"
#include "Poco/SharedPtr.h" #include "Poco/SharedPtr.h"
#include <map> #include <map>
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API PrivateKeyFactoryMgr class NetSSL_API PrivateKeyFactoryMgr
/// A PrivateKeyFactoryMgr manages all existing PrivateKeyFactories. /// A PrivateKeyFactoryMgr manages all existing PrivateKeyFactories.
{ {
public: public:
typedef std::map<std::string, Poco::SharedPtr<PrivateKeyFactory> > FactoriesMap; typedef std::map<std::string, Poco::SharedPtr<PrivateKeyFactory> > FactoriesMap;
PrivateKeyFactoryMgr(); PrivateKeyFactoryMgr();
/// Creates the PrivateKeyFactoryMgr. /// Creates the PrivateKeyFactoryMgr.
~PrivateKeyFactoryMgr(); ~PrivateKeyFactoryMgr();
/// Destroys the PrivateKeyFactoryMgr. /// Destroys the PrivateKeyFactoryMgr.
void setFactory(const std::string& name, PrivateKeyFactory* pFactory); void setFactory(const std::string& name, PrivateKeyFactory* pFactory);
/// Registers the factory. Class takes ownership of the pointer. /// Registers the factory. Class takes ownership of the pointer.
/// If a factory with the same name already exists, an exception is thrown. /// If a factory with the same name already exists, an exception is thrown.
bool hasFactory(const std::string& name) const; bool hasFactory(const std::string& name) const;
/// Returns true if for the given name a factory is already registered /// Returns true if for the given name a factory is already registered
const PrivateKeyFactory* getFactory(const std::string& name) const; const PrivateKeyFactory* getFactory(const std::string& name) const;
/// Returns NULL if for the given name a factory does not exist, otherwise the factory is returned /// Returns NULL if for the given name a factory does not exist, otherwise the factory is returned
void removeFactory(const std::string& name); void removeFactory(const std::string& name);
/// Removes the factory from the manager. /// Removes the factory from the manager.
private: private:
FactoriesMap _factories; FactoriesMap _factories;
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_PrivateKeyFactoryMgr_INCLUDED #endif // NetSSL_PrivateKeyFactoryMgr_INCLUDED

View File

@@ -1,105 +1,105 @@
// //
// PrivateKeyPassphraseHandler.h // PrivateKeyPassphraseHandler.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/PrivateKeyPassphraseHandler.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/PrivateKeyPassphraseHandler.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: PrivateKeyPassphraseHandler // Module: PrivateKeyPassphraseHandler
// //
// Definition of the PrivateKeyPassphraseHandler class. // Definition of the PrivateKeyPassphraseHandler class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_PrivateKeyPassphraseHandler_INCLUDED #ifndef NetSSL_PrivateKeyPassphraseHandler_INCLUDED
#define NetSSL_PrivateKeyPassphraseHandler_INCLUDED #define NetSSL_PrivateKeyPassphraseHandler_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API PrivateKeyPassphraseHandler class NetSSL_API PrivateKeyPassphraseHandler
/// A passphrase handler is needed whenever the private key of a certificate is loaded and the certificate is protected /// A passphrase handler is needed whenever the private key of a certificate is loaded and the certificate is protected
/// by a passphrase. The PrivateKeyPassphraseHandler's task is to provide that passphrase. /// by a passphrase. The PrivateKeyPassphraseHandler's task is to provide that passphrase.
/// One can install one's own PrivateKeyPassphraseHandler by implementing this interface. Note that /// One can install one's own PrivateKeyPassphraseHandler by implementing this interface. Note that
/// in the cpp file of the subclass the following code must be present (assuming you use the namespace My_API /// in the cpp file of the subclass the following code must be present (assuming you use the namespace My_API
/// and the name of your handler class is MyGuiHandler): /// and the name of your handler class is MyGuiHandler):
/// ///
/// #include "Poco/Net/PrivateKeyFactory.h" /// #include "Poco/Net/PrivateKeyFactory.h"
/// ... /// ...
/// POCO_REGISTER_KEYFACTORY(My_API, MyGuiHandler) /// POCO_REGISTER_KEYFACTORY(My_API, MyGuiHandler)
/// ///
/// One can either set the handler directly in the startup code of the main method of ones application by calling /// One can either set the handler directly in the startup code of the main method of ones application by calling
/// ///
/// SSLManager::instance().initialize(myguiHandler, myInvalidCertificateHandler, mySSLContext) /// SSLManager::instance().initialize(myguiHandler, myInvalidCertificateHandler, mySSLContext)
/// ///
/// or in case one's application extends Poco::Util::Application one can use an XML configuration and put the following entry /// or in case one's application extends Poco::Util::Application one can use an XML configuration and put the following entry
/// under the path openSSL.privateKeyPassphraseHandler: /// under the path openSSL.privateKeyPassphraseHandler:
/// ///
/// <privateKeyPassphraseHandler> /// <privateKeyPassphraseHandler>
/// <name>MyGuiHandler</name> /// <name>MyGuiHandler</name>
/// <options> /// <options>
/// [...] // Put optional config params for the handler here /// [...] // Put optional config params for the handler here
/// </options> /// </options>
/// </privateKeyPassphraseHandler> /// </privateKeyPassphraseHandler>
/// Note that the name of the passphrase handler must be same as the one provided to the POCO_REGISTER_KEYFACTORY macro. /// Note that the name of the passphrase handler must be same as the one provided to the POCO_REGISTER_KEYFACTORY macro.
{ {
public: public:
PrivateKeyPassphraseHandler(bool onServerSide); PrivateKeyPassphraseHandler(bool onServerSide);
/// Creates the PrivateKeyPassphraseHandler. Automatically registers at the SSLManager::PrivateKeyPassword event. /// Creates the PrivateKeyPassphraseHandler. Automatically registers at the SSLManager::PrivateKeyPassword event.
virtual ~PrivateKeyPassphraseHandler(); virtual ~PrivateKeyPassphraseHandler();
/// Destroys the PrivateKeyPassphraseHandler. /// Destroys the PrivateKeyPassphraseHandler.
virtual void onPrivateKeyRequested(const void* pSender, std::string& privateKey) = 0; virtual void onPrivateKeyRequested(const void* pSender, std::string& privateKey) = 0;
/// Returns the requested private key in the parameter privateKey. /// Returns the requested private key in the parameter privateKey.
bool serverSide() const; bool serverSide() const;
private: private:
bool _serverSide; bool _serverSide;
}; };
// //
// inlines // inlines
// //
inline bool PrivateKeyPassphraseHandler::serverSide() const inline bool PrivateKeyPassphraseHandler::serverSide() const
{ {
return _serverSide; return _serverSide;
} }
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_PrivateKeyPassphraseHandler_INCLUDED #endif // NetSSL_PrivateKeyPassphraseHandler_INCLUDED

View File

@@ -1,59 +1,59 @@
// //
// SSLException.h // SSLException.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SSLException.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SSLException.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: SSLException // Module: SSLException
// //
// Definition of the SSLException class. // Definition of the SSLException class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_SSLException_INCLUDED #ifndef NetSSL_SSLException_INCLUDED
#define NetSSL_SSLException_INCLUDED #define NetSSL_SSLException_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/NetException.h" #include "Poco/Net/NetException.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
POCO_DECLARE_EXCEPTION(NetSSL_API, SSLException, NetException) 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)
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_SSLException_INCLUDED #endif // NetSSL_SSLException_INCLUDED

View File

@@ -1,101 +1,101 @@
// //
// SSLInitializer.h // SSLInitializer.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SSLInitializer.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SSLInitializer.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: SSLInitializer // Module: SSLInitializer
// //
// Definition of the SSLInitializer class. // Definition of the SSLInitializer class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_SSLInitializer_INCLUDED #ifndef NetSSL_SSLInitializer_INCLUDED
#define NetSSL_SSLInitializer_INCLUDED #define NetSSL_SSLInitializer_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Mutex.h" #include "Poco/Mutex.h"
extern "C" extern "C"
{ {
struct CRYPTO_dynlock_value struct CRYPTO_dynlock_value
{ {
Poco::FastMutex _mutex; Poco::FastMutex _mutex;
}; };
} }
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API SSLInitializer class NetSSL_API SSLInitializer
/// Initalizes the OpenSSL library. /// Initalizes the OpenSSL library.
/// ///
/// The class ensures the earliest initialization and the /// The class ensures the earliest initialization and the
/// latest shutdown of the OpenSSL library. /// latest shutdown of the OpenSSL library.
{ {
public: public:
SSLInitializer(); SSLInitializer();
/// Automatically initialize OpenSSL on startup. /// Automatically initialize OpenSSL on startup.
~SSLInitializer(); ~SSLInitializer();
/// Automatically shut down OpenSSL on exit. /// Automatically shut down OpenSSL on exit.
static void initialize(); static void initialize();
/// Initializes the OpenSSL machinery. /// Initializes the OpenSSL machinery.
static void uninitialize(); static void uninitialize();
/// Shuts down the OpenSSL machinery. /// Shuts down the OpenSSL machinery.
protected: protected:
enum enum
{ {
SEEDSIZE = 256 SEEDSIZE = 256
}; };
// OpenSSL multithreading support // OpenSSL multithreading support
static void lock(int mode, int n, const char* file, int line); static void lock(int mode, int n, const char* file, int line);
static unsigned long id(); static unsigned long id();
static struct CRYPTO_dynlock_value* dynlockCreate(const char* file, int line); static struct CRYPTO_dynlock_value* dynlockCreate(const char* file, int line);
static void dynlock(int mode, struct CRYPTO_dynlock_value* lock, const char* file, int line); static void dynlock(int mode, struct CRYPTO_dynlock_value* lock, const char* file, int line);
static void dynlockDestroy(struct CRYPTO_dynlock_value* lock, const char* file, int line); static void dynlockDestroy(struct CRYPTO_dynlock_value* lock, const char* file, int line);
private: private:
static Poco::FastMutex* _mutexes; static Poco::FastMutex* _mutexes;
static int _rc; static int _rc;
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_SSLInitializer_INCLUDED #endif // NetSSL_SSLInitializer_INCLUDED

View File

@@ -1,271 +1,271 @@
// //
// SSLManager.h // SSLManager.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: SSLManager // Module: SSLManager
// //
// Definition of the SSLManager class. // Definition of the SSLManager class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_SSLManager_INCLUDED #ifndef NetSSL_SSLManager_INCLUDED
#define NetSSL_SSLManager_INCLUDED #define NetSSL_SSLManager_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/VerificationErrorArgs.h" #include "Poco/Net/VerificationErrorArgs.h"
#include "Poco/Net/Context.h" #include "Poco/Net/Context.h"
#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/BasicEvent.h" #include "Poco/BasicEvent.h"
#include "Poco/SharedPtr.h" #include "Poco/SharedPtr.h"
#include <openssl/ssl.h> #include <openssl/ssl.h>
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class Context; class Context;
class NetSSL_API SSLManager class NetSSL_API SSLManager
/// Class SSLManager. Singleton for holding the default server/client Context and PrivateKeyPassphraseHandler. /// Class SSLManager. Singleton for holding the default server/client Context and PrivateKeyPassphraseHandler.
/// Either initialize via Poco::Util::Application or via the /// Either initialize via Poco::Util::Application or via the
/// initialize methods of the singleton. Note that the latter initialization must happen very early /// initialize methods of the singleton. Note that the latter initialization must happen very early
/// during program startup before somebody calls defaultClientContext()/defaultServerContext() /// during program startup before somebody calls defaultClientContext()/defaultServerContext()
/// or any of the passPhraseHandler methods (which tries to auto-initialize /// or any of the passPhraseHandler methods (which tries to auto-initialize
/// the context and passphrase handler based on an Poco::Util::Application configuration). /// the context and passphrase handler based on an Poco::Util::Application configuration).
/// An exemplary documentation which sets either the server or client defaultcontext and creates a PrivateKeyPassphraseHandler /// An exemplary documentation which sets either the server or client defaultcontext and creates a PrivateKeyPassphraseHandler
/// that reads the password from the XML file looks like this: /// that reads the password from the XML file looks like this:
/// ///
/// <AppConfig> /// <AppConfig>
/// <openSSL> /// <openSSL>
/// <server|client> /// <server|client>
/// <privateKeyFile>any.pem</privateKeyFile> /// <privateKeyFile>any.pem</privateKeyFile>
/// <caConfig>rootcert.pem</caConfig> /// <caConfig>rootcert.pem</caConfig>
/// <verificationMode>relaxed</verificationMode> /// <verificationMode>relaxed</verificationMode>
/// <verificationDepth>9</verificationDepth> /// <verificationDepth>9</verificationDepth>
/// <loadDefaultCAFile>true</loadDefaultCAFile> /// <loadDefaultCAFile>true</loadDefaultCAFile>
/// <cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList> /// <cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList>
/// <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> /// <options>
/// </options> /// </options>
/// </invalidCertificateHandler> /// </invalidCertificateHandler>
/// </server|client> /// </server|client>
/// </openSSL> /// </openSSL>
/// </AppConfig> /// </AppConfig>
/// ///
{ {
public: public:
typedef Poco::SharedPtr<Context> ContextPtr; typedef Poco::SharedPtr<Context> ContextPtr;
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 /// Thrown whenever a certificate 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 /// Thrown whenever a certificate error is detected by the client during a handshake
Poco::BasicEvent<std::string> PrivateKeyPassPhrase; Poco::BasicEvent<std::string> PrivateKeyPassPhrase;
/// Thrown when a encrypted certificate is loaded. Not setting the passwd /// Thrown when a encrypted certificate is loaded. Not setting the passwd
/// 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)
/// which default delegate it should register. If nothing is configured, /// 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, ContextPtr ptrContext); void initializeServer(PrivateKeyPassphraseHandlerPtr& ptrPassPhraseHandler, InvalidCertificateHandlerPtr& ptrHandler, ContextPtr 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! /// Note: ALWAYS create the handlers before you create the context!
/// Valid initialization code would be: /// Valid initialization code would be:
/// SharedPtr<PrivateKeyPassphraseHandler> ptrConsole = new KeyConsoleHandler(); /// SharedPtr<PrivateKeyPassphraseHandler> ptrConsole = new KeyConsoleHandler();
/// SharedPtr<InvalidCertificateHandler> ptrCert = new ConsoleCertificateHandler(); /// SharedPtr<InvalidCertificateHandler> ptrCert = new ConsoleCertificateHandler();
/// SharedPtr<Context> ptrContext = new Context("any.pem", "rootcert.pem", Context::Relaxed, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"); /// SharedPtr<Context> ptrContext = new Context("any.pem", "rootcert.pem", Context::Relaxed, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
/// ///
/// This method can only be called, if no defaultContext is set yet. /// This method can only be called, if no defaultContext is set yet.
void initializeClient(PrivateKeyPassphraseHandlerPtr& ptrPassPhraseHandler, InvalidCertificateHandlerPtr& ptrHandler, ContextPtr ptrContext); void initializeClient(PrivateKeyPassphraseHandlerPtr& ptrPassPhraseHandler, InvalidCertificateHandlerPtr& ptrHandler, ContextPtr 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! /// Note: ALWAYS create the handlers before you create the context!
/// Valid initialization code would be: /// Valid initialization code would be:
/// SharedPtr<PrivateKeyPassphraseHandler> ptrConsole = new KeyConsoleHandler(); /// SharedPtr<PrivateKeyPassphraseHandler> ptrConsole = new KeyConsoleHandler();
/// SharedPtr<InvalidCertificateHandler> ptrCert = new ConsoleCertificateHandler(); /// SharedPtr<InvalidCertificateHandler> ptrCert = new ConsoleCertificateHandler();
/// SharedPtr<Context> ptrContext = new Context("any.pem", "rootcert.pem", Context::Relaxed, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"); /// SharedPtr<Context> ptrContext = new Context("any.pem", "rootcert.pem", Context::Relaxed, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
/// ///
/// This method can only be called, if no defaultContext is set yet. /// This method can only be called, if no defaultContext is set yet.
ContextPtr defaultServerContext(); ContextPtr 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. The first call to this method initializes the defaultContext
/// from an application configuration. /// from an application configuration.
ContextPtr defaultClientContext(); ContextPtr 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. The first call to this method initializes the defaultContext
/// from an application configuration. /// from an 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();
/// Returns the private key factory manager which stores the /// Returns the private key factory manager which stores the
/// 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 int verifyClientCallback(int ok, X509_STORE_CTX* pStore); static int verifyClientCallback(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 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 privateKeyPasswdCallback(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 const std::string CFG_SERVER_PREFIX; static const std::string CFG_SERVER_PREFIX;
static const std::string CFG_CLIENT_PREFIX; static const std::string CFG_CLIENT_PREFIX;
private: private:
SSLManager(); SSLManager();
/// Creates the SSLManager. /// Creates the SSLManager.
~SSLManager(); ~SSLManager();
/// Destroys the SSLManager. /// Destroys the SSLManager.
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);
/// 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.
PrivateKeyFactoryMgr _factoryMgr; PrivateKeyFactoryMgr _factoryMgr;
CertificateHandlerFactoryMgr _certHandlerFactoryMgr; CertificateHandlerFactoryMgr _certHandlerFactoryMgr;
ContextPtr _ptrDefaultServerContext; ContextPtr _ptrDefaultServerContext;
PrivateKeyPassphraseHandlerPtr _ptrServerPassPhraseHandler; PrivateKeyPassphraseHandlerPtr _ptrServerPassPhraseHandler;
InvalidCertificateHandlerPtr _ptrServerCertificateHandler; InvalidCertificateHandlerPtr _ptrServerCertificateHandler;
ContextPtr _ptrDefaultClientContext; ContextPtr _ptrDefaultClientContext;
PrivateKeyPassphraseHandlerPtr _ptrClientPassPhraseHandler; PrivateKeyPassphraseHandlerPtr _ptrClientPassPhraseHandler;
InvalidCertificateHandlerPtr _ptrClientCertificateHandler; InvalidCertificateHandlerPtr _ptrClientCertificateHandler;
static const std::string CFG_PRIV_KEY_FILE; static const std::string CFG_PRIV_KEY_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_CYPHER_LIST;
static const std::string VAL_CYPHER_LIST; static const std::string VAL_CYPHER_LIST;
static const std::string CFG_DELEGATE_HANDLER; static const std::string CFG_DELEGATE_HANDLER;
static const std::string VAL_DELEGATE_HANDLER; static const std::string VAL_DELEGATE_HANDLER;
static const std::string CFG_CERTIFICATE_HANDLER; static const std::string CFG_CERTIFICATE_HANDLER;
static const std::string VAL_CERTIFICATE_HANDLER; static const std::string VAL_CERTIFICATE_HANDLER;
friend class Poco::SingletonHolder<SSLManager>; friend class Poco::SingletonHolder<SSLManager>;
}; };
// //
// inlines // inlines
// //
inline PrivateKeyFactoryMgr& SSLManager::privateKeyFactoryMgr() inline PrivateKeyFactoryMgr& SSLManager::privateKeyFactoryMgr()
{ {
return _factoryMgr; return _factoryMgr;
} }
inline CertificateHandlerFactoryMgr& SSLManager::certificateHandlerFactoryMgr() inline CertificateHandlerFactoryMgr& SSLManager::certificateHandlerFactoryMgr()
{ {
return _certHandlerFactoryMgr; return _certHandlerFactoryMgr;
} }
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);
} }
inline int SSLManager::verifyClientCallback(int ok, X509_STORE_CTX* pStore) inline int SSLManager::verifyClientCallback(int ok, X509_STORE_CTX* pStore)
{ {
return SSLManager::verifyCallback(false, ok, pStore); return SSLManager::verifyCallback(false, ok, pStore);
} }
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_SSLManager_INCLUDED #endif // NetSSL_SSLManager_INCLUDED

View File

@@ -1,120 +1,120 @@
// //
// SecureServerSocket.h // SecureServerSocket.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SecureServerSocket.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SecureServerSocket.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLSockets // Package: SSLSockets
// Module: SecureServerSocket // Module: SecureServerSocket
// //
// Definition of the SecureServerSocket class. // Definition of the SecureServerSocket class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_SecureServerSocket_INCLUDED #ifndef NetSSL_SecureServerSocket_INCLUDED
#define NetSSL_SecureServerSocket_INCLUDED #define NetSSL_SecureServerSocket_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/ServerSocket.h" #include "Poco/Net/ServerSocket.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API SecureServerSocket: public ServerSocket class NetSSL_API SecureServerSocket: public ServerSocket
/// A server socket for secure SSL connections. /// A server socket for secure SSL connections.
{ {
public: public:
SecureServerSocket(); SecureServerSocket();
/// Creates a SSL server socket. /// Creates a SSL server socket.
/// ///
/// The server socket must be bound to /// The server socket must be bound to
/// an address and put into listening state. /// an address and put into listening state.
SecureServerSocket(const Socket& socket); SecureServerSocket(const Socket& socket);
/// Creates the SecureServerSocket with the SocketImpl /// Creates the SecureServerSocket with the SocketImpl
/// from another socket. The SocketImpl must be /// from another socket. The SocketImpl must be
/// a ServerSocketImpl, otherwise an InvalidArgumentException /// a ServerSocketImpl, otherwise an InvalidArgumentException
/// will be thrown. /// will be thrown.
SecureServerSocket(const SocketAddress& address, int backlog = 64); SecureServerSocket(const SocketAddress& address, int backlog = 64);
/// Creates a server socket, binds it /// Creates a server socket, binds it
/// to the given address and puts it in listening /// to the given address and puts it in listening
/// state. /// state.
/// ///
/// After successful construction, the server socket /// After successful construction, the server socket
/// is ready to accept connections. /// is ready to accept connections.
SecureServerSocket(Poco::UInt16 port, int backlog = 64); SecureServerSocket(Poco::UInt16 port, int backlog = 64);
/// Creates a server socket, binds it /// Creates a server socket, binds it
/// to the given port and puts it in listening /// to the given port and puts it in listening
/// state. /// state.
/// ///
/// After successful construction, the server socket /// After successful construction, the server socket
/// is ready to accept connections. /// is ready to accept connections.
virtual ~SecureServerSocket(); virtual ~SecureServerSocket();
/// Destroys the StreamSocket. /// Destroys the StreamSocket.
SecureServerSocket& operator = (const Socket& socket); SecureServerSocket& operator = (const Socket& socket);
/// 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.
StreamSocket acceptConnection(SocketAddress& clientAddr); StreamSocket acceptConnection(SocketAddress& clientAddr);
/// 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 TCP socket for the connection /// Returns a new SSL TCP 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.
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 TCP socket for the connection /// Returns a new TCP socket for the connection
/// with the client. /// with the client.
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_SecureServerSocket_INCLUDED #endif // NetSSL_SecureServerSocket_INCLUDED

View File

@@ -1,163 +1,163 @@
// //
// SecureServerSocketImpl.h // SecureServerSocketImpl.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SecureServerSocketImpl.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SecureServerSocketImpl.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLSockets // Package: SSLSockets
// Module: SecureServerSocketImpl // Module: SecureServerSocketImpl
// //
// Definition of the SecureServerSocketImpl class. // Definition of the SecureServerSocketImpl class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_SecureServerSocketImpl_INCLUDED #ifndef NetSSL_SecureServerSocketImpl_INCLUDED
#define NetSSL_SecureServerSocketImpl_INCLUDED #define NetSSL_SecureServerSocketImpl_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/SecureSocketImpl.h" #include "Poco/Net/SecureSocketImpl.h"
#include "Poco/Net/ServerSocketImpl.h" #include "Poco/Net/ServerSocketImpl.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API SecureServerSocketImpl: public ServerSocketImpl class NetSSL_API SecureServerSocketImpl: public ServerSocketImpl
/// The SocketImpl class for SecureServerSocket. /// The SocketImpl class for SecureServerSocket.
{ {
public: public:
SecureServerSocketImpl(); SecureServerSocketImpl();
/// Creates the SecureServerSocketImpl. /// Creates the SecureServerSocketImpl.
SocketImpl* acceptConnection(SocketAddress& clientAddr); SocketImpl* acceptConnection(SocketAddress& clientAddr);
/// 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 TCP socket for the connection /// Returns a new TCP 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 connect(const SocketAddress& address); void connect(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. /// 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
/// packets are restricted to the specified address. /// packets are restricted to the specified address.
void connect(const SocketAddress& address, const Poco::Timespan& timeout); void connect(const SocketAddress& address, const Poco::Timespan& timeout);
/// Initializes the socket, sets the socket timeout and /// Initializes the socket, sets the socket timeout and
/// establishes a connection to the TCP server at the given address. /// establishes a connection to the TCP server at the given address.
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 bind(const SocketAddress& address, bool reuseAddress = false); void bind(const SocketAddress& address, bool reuseAddress = false);
/// Bind a local address to the socket. /// 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. TCP clients should not bind a socket to a /// socket. TCP clients should not bind a socket to a
/// specific address. /// specific address.
/// ///
/// If reuseAddress is true, sets the SO_REUSEADDR /// If reuseAddress is true, sets the SO_REUSEADDR
/// socket option. /// socket option.
void listen(int backlog = 64); void listen(int backlog = 64);
/// Puts the socket into listening state. /// Puts the socket into listening state.
/// ///
/// The socket becomes a passive socket that /// The socket becomes a passive socket that
/// can accept incoming connection requests. /// can accept incoming connection requests.
/// ///
/// The backlog argument specifies the maximum /// The backlog argument specifies the maximum
/// number of connections that can be queued /// number of connections that can be queued
/// for this socket. /// for this socket.
void close(); void close();
/// Close the socket. /// Close the socket.
int sendBytes(const void* buffer, int length, int flags = 0); int sendBytes(const void* buffer, int length, int flags = 0);
/// Sends the contents of the given buffer through /// Sends the contents of the given buffer through
/// the socket. Any specified flags are ignored. /// 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.
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.
int sendTo(const void* buffer, int length, const SocketAddress& address, int flags = 0); int sendTo(const void* buffer, int length, const SocketAddress& address, int flags = 0);
/// Sends the contents of the given buffer through /// Sends the contents of the given buffer through
/// the socket to the given address. /// the socket to the given address.
/// ///
/// 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.
int receiveFrom(void* buffer, int length, SocketAddress& address, int flags = 0); int receiveFrom(void* buffer, int length, SocketAddress& address, 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.
/// Stores the address of the sender in address. /// Stores the address of the sender in address.
/// ///
/// Returns the number of bytes received. /// Returns the number of bytes received.
void sendUrgent(unsigned char data); void sendUrgent(unsigned char data);
/// Sends one byte of urgent data through /// Sends one byte of urgent data through
/// the socket. /// the socket.
/// ///
/// The data is sent with the MSG_OOB flag. /// The data is sent with the MSG_OOB flag.
/// ///
/// The preferred way for a socket to receive urgent data /// The preferred way for a socket to receive urgent data
/// is by enabling the SO_OOBINLINE option. /// is by enabling the SO_OOBINLINE option.
protected: protected:
~SecureServerSocketImpl(); ~SecureServerSocketImpl();
/// Destroys the SecureServerSocketImpl. /// Destroys the SecureServerSocketImpl.
private: private:
SecureServerSocketImpl(const SecureServerSocketImpl&); SecureServerSocketImpl(const SecureServerSocketImpl&);
SecureServerSocketImpl& operator = (const SecureServerSocketImpl&); SecureServerSocketImpl& operator = (const SecureServerSocketImpl&);
private: private:
SecureSocketImpl _socket; SecureSocketImpl _socket;
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_SecureServerSocketImpl_INCLUDED #endif // NetSSL_SecureServerSocketImpl_INCLUDED

View File

@@ -1,91 +1,91 @@
// //
// SecureStreamSocket.h // SecureStreamSocket.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SecureStreamSocket.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SecureStreamSocket.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLSockets // Package: SSLSockets
// Module: SecureStreamSocket // Module: SecureStreamSocket
// //
// Definition of the SecureStreamSocket class. // Definition of the SecureStreamSocket class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_SecureStreamSocket_INCLUDED #ifndef NetSSL_SecureStreamSocket_INCLUDED
#define NetSSL_SecureStreamSocket_INCLUDED #define NetSSL_SecureStreamSocket_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/StreamSocket.h" #include "Poco/Net/StreamSocket.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API SecureStreamSocket: public StreamSocket class NetSSL_API SecureStreamSocket: public StreamSocket
/// A subclass of StreamSocket for secure SSL sockets. /// A subclass of StreamSocket for secure SSL sockets.
{ {
public: public:
SecureStreamSocket(); SecureStreamSocket();
/// Creates an unconnected stream socket. /// Creates an unconnected stream socket.
/// ///
/// 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().
SecureStreamSocket(const SocketAddress& address); SecureStreamSocket(const SocketAddress& address);
/// Creates a stream socket and connects it to /// Creates a stream socket and connects it to
/// the socket specified by address. /// the socket specified by address.
SecureStreamSocket(const Socket& socket); SecureStreamSocket(const Socket& socket);
/// Creates the StreamSocket with the SocketImpl /// Creates the StreamSocket with the SocketImpl
/// from another socket. The SocketImpl must be /// from another socket. The SocketImpl must be
/// a StreamSocketImpl, otherwise an InvalidArgumentException /// a StreamSocketImpl, otherwise an InvalidArgumentException
/// will be thrown. /// will be thrown.
virtual ~SecureStreamSocket(); virtual ~SecureStreamSocket();
/// Destroys the StreamSocket. /// Destroys the StreamSocket.
SecureStreamSocket& operator = (const Socket& socket); SecureStreamSocket& operator = (const Socket& socket);
/// 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.
protected: protected:
SecureStreamSocket(SocketImpl* pImpl); SecureStreamSocket(SocketImpl* pImpl);
friend class SecureServerSocket; friend class SecureServerSocket;
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_SecureStreamSocket_INCLUDED #endif // NetSSL_SecureStreamSocket_INCLUDED

View File

@@ -1,184 +1,184 @@
// //
// SecureStreamSocketImpl.h // SecureStreamSocketImpl.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SecureStreamSocketImpl.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/SecureStreamSocketImpl.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLSockets // Package: SSLSockets
// Module: SecureStreamSocketImpl // Module: SecureStreamSocketImpl
// //
// Definition of the SecureStreamSocketImpl class. // Definition of the SecureStreamSocketImpl class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_SecureStreamSocketImpl_INCLUDED #ifndef NetSSL_SecureStreamSocketImpl_INCLUDED
#define NetSSL_SecureStreamSocketImpl_INCLUDED #define NetSSL_SecureStreamSocketImpl_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/SecureSocketImpl.h" #include "Poco/Net/SecureSocketImpl.h"
#include "Poco/Net/StreamSocketImpl.h" #include "Poco/Net/StreamSocketImpl.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API SecureStreamSocketImpl: public StreamSocketImpl class NetSSL_API SecureStreamSocketImpl: public StreamSocketImpl
/// This class implements a SSL TCP socket. /// This class implements a SSL TCP socket.
{ {
public: public:
SecureStreamSocketImpl(); SecureStreamSocketImpl();
/// Creates the SecureStreamSocketImpl. /// Creates the SecureStreamSocketImpl.
SecureStreamSocketImpl(SSL* _pSSL); SecureStreamSocketImpl(SSL* _pSSL);
/// Creates a SecureStreamSocketImpl using the given native socket. /// Creates a SecureStreamSocketImpl using the given native socket.
SocketImpl* acceptConnection(SocketAddress& clientAddr); SocketImpl* acceptConnection(SocketAddress& clientAddr);
/// 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 TCP socket for the connection /// Returns a new TCP 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 connect(const SocketAddress& address); void connect(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. /// 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
/// packets are restricted to the specified address. /// packets are restricted to the specified address.
void connect(const SocketAddress& address, const Poco::Timespan& timeout); void connect(const SocketAddress& address, const Poco::Timespan& timeout);
/// Initializes the socket, sets the socket timeout and /// Initializes the socket, sets the socket timeout and
/// establishes a connection to the TCP server at the given address. /// establishes a connection to the TCP server at the given address.
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 bind(const SocketAddress& address, bool reuseAddress = false); void bind(const SocketAddress& address, bool reuseAddress = false);
/// Bind a local address to the socket. /// 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. TCP clients should not bind a socket to a /// socket. TCP clients should not bind a socket to a
/// specific address. /// specific address.
/// ///
/// If reuseAddress is true, sets the SO_REUSEADDR /// If reuseAddress is true, sets the SO_REUSEADDR
/// socket option. /// socket option.
void listen(int backlog = 64); void listen(int backlog = 64);
/// Puts the socket into listening state. /// Puts the socket into listening state.
/// ///
/// The socket becomes a passive socket that /// The socket becomes a passive socket that
/// can accept incoming connection requests. /// can accept incoming connection requests.
/// ///
/// The backlog argument specifies the maximum /// The backlog argument specifies the maximum
/// number of connections that can be queued /// number of connections that can be queued
/// for this socket. /// for this socket.
void close(); void close();
/// Close the socket. /// Close the socket.
int sendBytes(const void* buffer, int length, int flags = 0); int sendBytes(const void* buffer, int length, int flags = 0);
/// Sends the contents of the given buffer through /// Sends the contents of the given buffer through
/// the socket. Any specified flags are ignored. /// 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.
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.
int sendTo(const void* buffer, int length, const SocketAddress& address, int flags = 0); int sendTo(const void* buffer, int length, const SocketAddress& address, int flags = 0);
/// Sends the contents of the given buffer through /// Sends the contents of the given buffer through
/// the socket to the given address. /// the socket to the given address.
/// ///
/// 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.
int receiveFrom(void* buffer, int length, SocketAddress& address, int flags = 0); int receiveFrom(void* buffer, int length, SocketAddress& address, 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.
/// Stores the address of the sender in address. /// Stores the address of the sender in address.
/// ///
/// Returns the number of bytes received. /// Returns the number of bytes received.
void sendUrgent(unsigned char data); void sendUrgent(unsigned char data);
/// Sends one byte of urgent data through /// Sends one byte of urgent data through
/// the socket. /// the socket.
/// ///
/// The data is sent with the MSG_OOB flag. /// The data is sent with the MSG_OOB flag.
/// ///
/// The preferred way for a socket to receive urgent data /// The preferred way for a socket to receive urgent data
/// is by enabling the SO_OOBINLINE option. /// is by enabling the SO_OOBINLINE option.
void setTunnelEndPoint(const std::string& host, Poco::UInt16 port); void setTunnelEndPoint(const std::string& host, Poco::UInt16 port);
/// Due to the fact that SSLConnections that run over proxies require /// Due to the fact that SSLConnections that run over proxies require
/// a different connect phase (ie send an unencrypted HTTP CONNECT before /// a different connect phase (ie send an unencrypted HTTP CONNECT before
/// establishing, we must inform the socket that it is only used as a proxy /// establishing, we must inform the socket that it is only used as a proxy
/// that works as a tunnel to the given endPoint. /// that works as a tunnel to the given endPoint.
/// Only call this method on disconnected sockets. /// Only call this method on disconnected sockets.
protected: protected:
~SecureStreamSocketImpl(); ~SecureStreamSocketImpl();
/// Destroys the SecureStreamSocketImpl. /// Destroys the SecureStreamSocketImpl.
private: private:
SecureStreamSocketImpl(const SecureStreamSocketImpl&); SecureStreamSocketImpl(const SecureStreamSocketImpl&);
SecureStreamSocketImpl& operator = (const SecureStreamSocketImpl&); SecureStreamSocketImpl& operator = (const SecureStreamSocketImpl&);
private: private:
SecureSocketImpl _socket; SecureSocketImpl _socket;
friend class SecureSocketImpl; friend class SecureSocketImpl;
}; };
// //
// inlines // inlines
// //
inline void SecureStreamSocketImpl::setTunnelEndPoint(const std::string& host, Poco::UInt16 port) inline void SecureStreamSocketImpl::setTunnelEndPoint(const std::string& host, Poco::UInt16 port)
{ {
_socket.setTunnelEndPoint(host, port); _socket.setTunnelEndPoint(host, port);
} }
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_SecureStreamSocketImpl_INCLUDED #endif // NetSSL_SecureStreamSocketImpl_INCLUDED

View File

@@ -1,72 +1,72 @@
// //
// Utility.h // Utility.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/Utility.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/Utility.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: Utility // Module: Utility
// //
// Definition of the Utility class. // Definition of the Utility class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_Utility_INCLUDED #ifndef NetSSL_Utility_INCLUDED
#define NetSSL_Utility_INCLUDED #define NetSSL_Utility_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/Context.h" #include "Poco/Net/Context.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API Utility class NetSSL_API Utility
/// Class Utility. helper class for init & shutdown of the OpenSSL library /// Class Utility. helper class for init & shutdown of the OpenSSL library
{ {
public: public:
static int HTTPS_PORT; static int HTTPS_PORT;
/// Default port value for HHTPS /// Default port value for HHTPS
static Context::VerificationMode convertVerificationMode(const std::string& verMode); static Context::VerificationMode convertVerificationMode(const std::string& verMode);
/// Non-case sensitive conversion of a string to a VerificationMode enum. /// Non-case sensitive conversion of a string to a VerificationMode enum.
/// If verMode is illegal an OptionException is thrown. /// If verMode is illegal an OptionException is thrown.
static std::string convertCertificateError(long errCode); static std::string convertCertificateError(long errCode);
/// Converts an SSL error code into human readable form /// Converts an SSL error code into human readable form
static std::string convertSSLError(SSL* pSSL, int errCode); static std::string convertSSLError(SSL* pSSL, int errCode);
}; };
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_Utility_INCLUDED #endif // NetSSL_Utility_INCLUDED

View File

@@ -1,130 +1,130 @@
// //
// VerificationErrorArgs.h // VerificationErrorArgs.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/VerificationErrorArgs.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/include/Poco/Net/VerificationErrorArgs.h#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: VerificationErrorArgs // Module: VerificationErrorArgs
// //
// Definition of the VerificationErrorArgs class. // Definition of the VerificationErrorArgs class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSL_VerificationErrorArgs_INCLUDED #ifndef NetSSL_VerificationErrorArgs_INCLUDED
#define NetSSL_VerificationErrorArgs_INCLUDED #define NetSSL_VerificationErrorArgs_INCLUDED
#include "Poco/Net/NetSSL.h" #include "Poco/Net/NetSSL.h"
#include "Poco/Net/X509Certificate.h" #include "Poco/Net/X509Certificate.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
class NetSSL_API VerificationErrorArgs class NetSSL_API VerificationErrorArgs
/// A utility class for certificate error handling. /// A utility class for certificate error handling.
{ {
public: public:
VerificationErrorArgs(const X509Certificate& cert, int errDepth, int errNum, const std::string& errMsg); VerificationErrorArgs(const X509Certificate& cert, int errDepth, int errNum, const std::string& errMsg);
/// Creates the VerificationErrorArgs. _ignoreError is per default set to false. /// Creates the VerificationErrorArgs. _ignoreError is per default set to false.
~VerificationErrorArgs(); ~VerificationErrorArgs();
/// Destroys the VerificationErrorArgs. /// Destroys the VerificationErrorArgs.
const X509Certificate& certificate() const; const X509Certificate& certificate() const;
/// Returns the certificate that caused the error. /// Returns the certificate that caused the error.
int errorDepth() const; int errorDepth() const;
/// Returns the position of the certificate in the certificate chain. /// Returns the position of the certificate in the certificate chain.
int errorNumber() const; int errorNumber() const;
/// Returns the id of the error /// Returns the id of the error
const std::string& errorMessage() const; const std::string& errorMessage() const;
/// Returns the textual presentation of the errorNumber. /// Returns the textual presentation of the errorNumber.
void setIgnoreError(bool ignoreError); void setIgnoreError(bool ignoreError);
/// setIgnoreError to true, if a verification error is judged non-fatal by the user. /// setIgnoreError to true, if a verification error is judged non-fatal by the user.
bool getIgnoreError() const; bool getIgnoreError() const;
/// returns the value of _ignoreError /// returns the value of _ignoreError
private: private:
X509Certificate _cert; X509Certificate _cert;
int _errorDepth; int _errorDepth;
int _errorNumber; int _errorNumber;
std::string _errorMessage; /// Textual representation of the _errorNumber std::string _errorMessage; /// Textual representation of the _errorNumber
bool _ignoreError; bool _ignoreError;
}; };
// //
// inlines // inlines
// //
inline const X509Certificate& VerificationErrorArgs::certificate() const inline const X509Certificate& VerificationErrorArgs::certificate() const
{ {
return _cert; return _cert;
} }
inline int VerificationErrorArgs::errorDepth() const inline int VerificationErrorArgs::errorDepth() const
{ {
return _errorDepth; return _errorDepth;
} }
inline int VerificationErrorArgs::errorNumber() const inline int VerificationErrorArgs::errorNumber() const
{ {
return _errorNumber; return _errorNumber;
} }
inline const std::string& VerificationErrorArgs::errorMessage() const inline const std::string& VerificationErrorArgs::errorMessage() const
{ {
return _errorMessage; return _errorMessage;
} }
inline void VerificationErrorArgs::setIgnoreError(bool ignoreError) inline void VerificationErrorArgs::setIgnoreError(bool ignoreError)
{ {
_ignoreError = ignoreError; _ignoreError = ignoreError;
} }
inline bool VerificationErrorArgs::getIgnoreError() const inline bool VerificationErrorArgs::getIgnoreError() const
{ {
return _ignoreError; return _ignoreError;
} }
} } // namespace Poco::Net } } // namespace Poco::Net
#endif // NetSSL_VerificationErrorArgs_INCLUDED #endif // NetSSL_VerificationErrorArgs_INCLUDED

View File

@@ -1,29 +1,29 @@
# This is a sample configuration file for HTTPTimeServer # This is a sample configuration file for HTTPTimeServer
logging.loggers.root.channel.class = ConsoleChannel logging.loggers.root.channel.class = ConsoleChannel
logging.loggers.app.name = Application logging.loggers.app.name = Application
logging.loggers.app.channel = c1 logging.loggers.app.channel = c1
logging.formatters.f1.class = PatternFormatter logging.formatters.f1.class = PatternFormatter
logging.formatters.f1.pattern = [%p] %t logging.formatters.f1.pattern = [%p] %t
logging.channels.c1.class = ConsoleChannel logging.channels.c1.class = ConsoleChannel
logging.channels.c1.formatter = f1 logging.channels.c1.formatter = f1
# HTTPSTimeServer.format = %W, %e %b %y %H:%M:%S %Z # HTTPSTimeServer.format = %W, %e %b %y %H:%M:%S %Z
# HTTPSTimeServer.port = 9980 # HTTPSTimeServer.port = 9980
# openSSL.client.privateKeyFile = ${application.configDir}any.pem # openSSL.client.privateKeyFile = ${application.configDir}any.pem
# openSSL.client.caConfig = ${application.configDir}rootcert.pem # openSSL.client.caConfig = ${application.configDir}rootcert.pem
# openSSL.client.verificationMode = relaxed # openSSL.client.verificationMode = relaxed
# openSSL.client.verificationDepth = 9 # openSSL.client.verificationDepth = 9
# openSSL.client.loadDefaultCAFile = false # openSSL.client.loadDefaultCAFile = false
# openSSL.client.cypherList = ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH # openSSL.client.cypherList = ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH
# openSSL.client.privateKeyPassphraseHandler.name = KeyFileHandler # openSSL.client.privateKeyPassphraseHandler.name = KeyFileHandler
# openSSL.client.privateKeyPassphraseHandler.options.password = test # openSSL.client.privateKeyPassphraseHandler.options.password = test
# openSSL.client.invalidCertificateHandler = AcceptCertificateHandler # openSSL.client.invalidCertificateHandler = AcceptCertificateHandler
openSSL.server.privateKeyFile = ${application.configDir}any.pem openSSL.server.privateKeyFile = ${application.configDir}any.pem
openSSL.server.caConfig = ${application.configDir}rootcert.pem openSSL.server.caConfig = ${application.configDir}rootcert.pem
openSSL.server.verificationMode = none openSSL.server.verificationMode = none
openSSL.server.verificationDepth = 9 openSSL.server.verificationDepth = 9
openSSL.server.loadDefaultCAFile = false openSSL.server.loadDefaultCAFile = false
openSSL.server.cypherList = ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH openSSL.server.cypherList = ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH
openSSL.server.privateKeyPassphraseHandler.name = KeyFileHandler openSSL.server.privateKeyPassphraseHandler.name = KeyFileHandler
openSSL.server.privateKeyPassphraseHandler.options.password = test openSSL.server.privateKeyPassphraseHandler.options.password = test
openSSL.server.invalidCertificateHandler = AcceptCertificateHandler openSSL.server.invalidCertificateHandler = AcceptCertificateHandler

View File

@@ -1,7 +1,7 @@
# #
# sample.vmsbuild # sample.vmsbuild
# #
# $Id: //poco/Main/Net/samples/HTTPTimeServer/HTTPTimeServer.vmsbuild#1 $ # $Id: //poco/Main/Net/samples/HTTPTimeServer/HTTPTimeServer.vmsbuild#1 $
# #
EXE=HTTPSTimeServer EXE=HTTPSTimeServer
HTTPSTimeServer HTTPSTimeServer

View File

@@ -1,152 +1,152 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.10" Version="7.10"
Name="HTTPSTimeServer" Name="HTTPSTimeServer"
ProjectGUID="{B11672FF-4E0A-4cf4-8FC0-0AEEAF962158}" ProjectGUID="{B11672FF-4E0A-4cf4-8FC0-0AEEAF962158}"
Keyword="Win32Proj"> Keyword="Win32Proj">
<Platforms> <Platforms>
<Platform <Platform
Name="Win32"/> Name="Win32"/>
</Platforms> </Platforms>
<Configurations> <Configurations>
<Configuration <Configuration
Name="debug_shared|Win32" Name="debug_shared|Win32"
OutputDirectory="obj\debug_shared" OutputDirectory="obj\debug_shared"
IntermediateDirectory="obj\debug_shared" IntermediateDirectory="obj\debug_shared"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2"> CharacterSet="2">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include" AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
MinimalRebuild="TRUE" MinimalRebuild="TRUE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
BufferSecurityCheck="TRUE" BufferSecurityCheck="TRUE"
TreatWChar_tAsBuiltInType="TRUE" TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="TRUE" ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE" RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/> DebugInformationFormat="4"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="PocoFoundationd.lib PocoXMLd.lib PocoNetd.lib PocoUtild.lib PocoNetSSLd.lib" AdditionalDependencies="PocoFoundationd.lib PocoXMLd.lib PocoNetd.lib PocoUtild.lib PocoNetSSLd.lib"
OutputFile="bin/HTTPSTimeServerd.exe" OutputFile="bin/HTTPSTimeServerd.exe"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib" AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="TRUE" GenerateDebugInformation="TRUE"
ProgramDatabaseFile="bin/HTTPSTimeServerd.pdb" ProgramDatabaseFile="bin/HTTPSTimeServerd.pdb"
SubSystem="1" SubSystem="1"
TargetMachine="1"/> TargetMachine="1"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCPostBuildEventTool"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool"/> Name="VCResourceCompilerTool"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool <Tool
Name="VCManagedWrapperGeneratorTool"/> Name="VCManagedWrapperGeneratorTool"/>
<Tool <Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
<Configuration <Configuration
Name="release_shared|Win32" Name="release_shared|Win32"
OutputDirectory="obj\release_shared" OutputDirectory="obj\release_shared"
IntermediateDirectory="obj\release_shared" IntermediateDirectory="obj\release_shared"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2"> CharacterSet="2">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="4" Optimization="4"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
EnableIntrinsicFunctions="TRUE" EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="TRUE" OmitFramePointers="TRUE"
OptimizeForWindowsApplication="TRUE" OptimizeForWindowsApplication="TRUE"
AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include" AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="FALSE" BufferSecurityCheck="FALSE"
TreatWChar_tAsBuiltInType="TRUE" TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="TRUE" ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE" RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/> DebugInformationFormat="3"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="PocoFoundation.lib PocoXML.lib PocoNet.lib PocoUtil.lib PocoNetSSL.lib" AdditionalDependencies="PocoFoundation.lib PocoXML.lib PocoNet.lib PocoUtil.lib PocoNetSSL.lib"
OutputFile="bin/HTTPSTimeServer.exe" OutputFile="bin/HTTPSTimeServer.exe"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\lib" AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="FALSE" GenerateDebugInformation="FALSE"
ProgramDatabaseFile="" ProgramDatabaseFile=""
SubSystem="1" SubSystem="1"
OptimizeReferences="2" OptimizeReferences="2"
EnableCOMDATFolding="2" EnableCOMDATFolding="2"
TargetMachine="1"/> TargetMachine="1"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCPostBuildEventTool"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool"/> Name="VCResourceCompilerTool"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool <Tool
Name="VCManagedWrapperGeneratorTool"/> Name="VCManagedWrapperGeneratorTool"/>
<Tool <Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>
<Files> <Files>
<Filter <Filter
Name="Configuration Files" Name="Configuration Files"
Filter=""> Filter="">
<File <File
RelativePath=".\HTTPSTimeServer.properties"> RelativePath=".\HTTPSTimeServer.properties">
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\HTTPSTimeServer.cpp"> RelativePath=".\src\HTTPSTimeServer.cpp">
</File> </File>
</Filter> </Filter>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>
</VisualStudioProject> </VisualStudioProject>

View File

@@ -1,217 +1,217 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8,00" Version="8,00"
Name="HTTPSTimeServer" Name="HTTPSTimeServer"
ProjectGUID="{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}" ProjectGUID="{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}"
Keyword="Win32Proj" Keyword="Win32Proj"
> >
<Platforms> <Platforms>
<Platform <Platform
Name="Win32" Name="Win32"
/> />
</Platforms> </Platforms>
<ToolFiles> <ToolFiles>
</ToolFiles> </ToolFiles>
<Configurations> <Configurations>
<Configuration <Configuration
Name="debug_shared|Win32" Name="debug_shared|Win32"
OutputDirectory="obj\debug_shared" OutputDirectory="obj\debug_shared"
IntermediateDirectory="obj\debug_shared" IntermediateDirectory="obj\debug_shared"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2" CharacterSet="2"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
/> />
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool" Name="VCWebServiceProxyGeneratorTool"
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include" AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
BufferSecurityCheck="true" BufferSecurityCheck="true"
TreatWChar_tAsBuiltInType="true" TreatWChar_tAsBuiltInType="true"
ForceConformanceInForLoopScope="true" ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true" RuntimeTypeInfo="true"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="4" DebugInformationFormat="4"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"
/> />
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="PocoFoundationd.lib PocoXMLd.lib PocoNetd.lib PocoUtild.lib PocoNetSSLd.lib" AdditionalDependencies="PocoFoundationd.lib PocoXMLd.lib PocoNetd.lib PocoUtild.lib PocoNetSSLd.lib"
OutputFile="bin/HTTPSTimeServerd.exe" OutputFile="bin/HTTPSTimeServerd.exe"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib" AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile="bin/HTTPSTimeServerd.pdb" ProgramDatabaseFile="bin/HTTPSTimeServerd.pdb"
SubSystem="1" SubSystem="1"
TargetMachine="1" TargetMachine="1"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
/> />
<Tool <Tool
Name="VCManifestTool" Name="VCManifestTool"
/> />
<Tool <Tool
Name="VCXDCMakeTool" Name="VCXDCMakeTool"
/> />
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
/> />
<Tool <Tool
Name="VCFxCopTool" Name="VCFxCopTool"
/> />
<Tool <Tool
Name="VCAppVerifierTool" Name="VCAppVerifierTool"
/> />
<Tool <Tool
Name="VCWebDeploymentTool" Name="VCWebDeploymentTool"
/> />
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="release_shared|Win32" Name="release_shared|Win32"
OutputDirectory="obj\release_shared" OutputDirectory="obj\release_shared"
IntermediateDirectory="obj\release_shared" IntermediateDirectory="obj\release_shared"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2" CharacterSet="2"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
/> />
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool" Name="VCWebServiceProxyGeneratorTool"
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="4" Optimization="4"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include" AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
StringPooling="true" StringPooling="true"
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="false" BufferSecurityCheck="false"
TreatWChar_tAsBuiltInType="true" TreatWChar_tAsBuiltInType="true"
ForceConformanceInForLoopScope="true" ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true" RuntimeTypeInfo="true"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"
/> />
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="PocoFoundation.lib PocoXML.lib PocoNet.lib PocoUtil.lib PocoNetSSL.lib" AdditionalDependencies="PocoFoundation.lib PocoXML.lib PocoNet.lib PocoUtil.lib PocoNetSSL.lib"
OutputFile="bin/HTTPSTimeServer.exe" OutputFile="bin/HTTPSTimeServer.exe"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\lib" AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="false" GenerateDebugInformation="false"
ProgramDatabaseFile="" ProgramDatabaseFile=""
SubSystem="1" SubSystem="1"
OptimizeReferences="2" OptimizeReferences="2"
EnableCOMDATFolding="2" EnableCOMDATFolding="2"
TargetMachine="1" TargetMachine="1"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
/> />
<Tool <Tool
Name="VCManifestTool" Name="VCManifestTool"
/> />
<Tool <Tool
Name="VCXDCMakeTool" Name="VCXDCMakeTool"
/> />
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
/> />
<Tool <Tool
Name="VCFxCopTool" Name="VCFxCopTool"
/> />
<Tool <Tool
Name="VCAppVerifierTool" Name="VCAppVerifierTool"
/> />
<Tool <Tool
Name="VCWebDeploymentTool" Name="VCWebDeploymentTool"
/> />
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>
<Files> <Files>
<Filter <Filter
Name="Configuration Files" Name="Configuration Files"
> >
<File <File
RelativePath=".\HTTPSTimeServer.properties" RelativePath=".\HTTPSTimeServer.properties"
> >
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Source Files" Name="Source Files"
> >
<File <File
RelativePath=".\src\HTTPSTimeServer.cpp" RelativePath=".\src\HTTPSTimeServer.cpp"
> >
</File> </File>
</Filter> </Filter>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>
</VisualStudioProject> </VisualStudioProject>

View File

@@ -1,48 +1,48 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIICaDCCAdECCQCzfxSsk7yaLjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB MIICaDCCAdECCQCzfxSsk7yaLjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB
VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV
BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA
aW5mLmNvbTAeFw0wNjAzMDExMzA3MzFaFw0wNjAzMzExMzA3MzFaMH4xCzAJBgNV aW5mLmNvbTAeFw0wNjAzMDExMzA3MzFaFw0wNjAzMzExMzA3MzFaMH4xCzAJBgNV
BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExETAPBgNVBAcTCFN0IEpha29iMRww BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExETAPBgNVBAcTCFN0IEpha29iMRww
GgYDVQQKExNBcHBsaWVkIEluZm9ybWF0aWNzMQowCAYDVQQDFAEqMR4wHAYJKoZI GgYDVQQKExNBcHBsaWVkIEluZm9ybWF0aWNzMQowCAYDVQQDFAEqMR4wHAYJKoZI
hvcNAQkBFg9pbmZvQGFwcGluZi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ hvcNAQkBFg9pbmZvQGFwcGluZi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ
AoGBAJHGyXDHyCYoWz+65ltNwwZbhwOGnxr9P1WMATuFJh0bPBZxKbZRdbTm9KhZ AoGBAJHGyXDHyCYoWz+65ltNwwZbhwOGnxr9P1WMATuFJh0bPBZxKbZRdbTm9KhZ
OlvsEIsfgiYdsxURYIqXfEgISYLZcZY0pQwGEOmB+0NeC/+ENSfOlNSthx6zSVlc OlvsEIsfgiYdsxURYIqXfEgISYLZcZY0pQwGEOmB+0NeC/+ENSfOlNSthx6zSVlc
zhJ7+dJOGwepHAiLr1fRuc5jogYLraE+lKTnqAAFfzwvti77AgMBAAEwDQYJKoZI zhJ7+dJOGwepHAiLr1fRuc5jogYLraE+lKTnqAAFfzwvti77AgMBAAEwDQYJKoZI
hvcNAQEFBQADgYEAY/ZoeY1ukkEJX7259NeoVM0oahlulWV0rlCqyaeosOiDORPT hvcNAQEFBQADgYEAY/ZoeY1ukkEJX7259NeoVM0oahlulWV0rlCqyaeosOiDORPT
m6X1w/5MTCf9VyaD1zukoSZ4QqNVjHFXcXidbB7Tgt3yRuZ5PC5LIFCDPv9mgPne m6X1w/5MTCf9VyaD1zukoSZ4QqNVjHFXcXidbB7Tgt3yRuZ5PC5LIFCDPv9mgPne
mUA70yfctNfza2z3ZiQ6NDkW3mZX+1tmxYIrJQIrkVeYeqf1Gh2nyZrUMcE= mUA70yfctNfza2z3ZiQ6NDkW3mZX+1tmxYIrJQIrkVeYeqf1Gh2nyZrUMcE=
-----END CERTIFICATE----- -----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY----- -----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,E7AE93C9E49184EA DEK-Info: DES-EDE3-CBC,E7AE93C9E49184EA
A2IqzNcWs+I5vzV+i+woDk56+yr58eU0Onw8eEvXkLjnSc58JU4327IF7yUbKWdW A2IqzNcWs+I5vzV+i+woDk56+yr58eU0Onw8eEvXkLjnSc58JU4327IF7yUbKWdW
Q7BYGGOkVFiZ7ANOwviDg5SUhxRDWCcW8dS6/p1vfdQ1C3qj2OwJjkpg0aDBIzJn Q7BYGGOkVFiZ7ANOwviDg5SUhxRDWCcW8dS6/p1vfdQ1C3qj2OwJjkpg0aDBIzJn
FzgguT3MF3ama77vxv0S3kOfmCj62MLqPGpj5pQ0/1hefRFbL8oAX8bXUN7/rmGM FzgguT3MF3ama77vxv0S3kOfmCj62MLqPGpj5pQ0/1hefRFbL8oAX8bXUN7/rmGM
Zc0QyzFZv2iQ04dY/6TNclwKPB4H0On4K+8BMs3PRkWA0clCaQaFO2+iwnk3XZfe Zc0QyzFZv2iQ04dY/6TNclwKPB4H0On4K+8BMs3PRkWA0clCaQaFO2+iwnk3XZfe
+MsKUEbLCpAQeYspYv1cw38dCdWq1KTP5aJk+oXgwjfX5cAaPTz74NTqTIsCcaTD +MsKUEbLCpAQeYspYv1cw38dCdWq1KTP5aJk+oXgwjfX5cAaPTz74NTqTIsCcaTD
3vy7ukJYFlDR9Kyo7z8rMazYrKJslhnuRH0BhK9st9McwL957j5tZmrKyraCcmCx 3vy7ukJYFlDR9Kyo7z8rMazYrKJslhnuRH0BhK9st9McwL957j5tZmrKyraCcmCx
dMAGcsis1va3ayYZpIpFqA4EhYrTM+6N8ZRfUap20+b5IQwHfTQDejUhL6rBwy7j dMAGcsis1va3ayYZpIpFqA4EhYrTM+6N8ZRfUap20+b5IQwHfTQDejUhL6rBwy7j
Ti5yD83/itoOMyXq2sV/XWfVD5zk/P5iv22O1EAQMhhnPB9K/I/JhuSGQJfn3cNh Ti5yD83/itoOMyXq2sV/XWfVD5zk/P5iv22O1EAQMhhnPB9K/I/JhuSGQJfn3cNh
ykOUYT0+vDeSeEVa+FVEP1W35G0alTbKbNs5Tb8KxJ3iDJUxokM//SvPXZy9hOVX ykOUYT0+vDeSeEVa+FVEP1W35G0alTbKbNs5Tb8KxJ3iDJUxokM//SvPXZy9hOVX
Y05imB04J15DaGbAHlNzunhuJi7121WV/JRXZRW9diE6hwpD8rwqi3FMuRUmy7U9 Y05imB04J15DaGbAHlNzunhuJi7121WV/JRXZRW9diE6hwpD8rwqi3FMuRUmy7U9
aFA5poKRAYlo9YtZ3YpFyjGKB6MfCQcB2opuSnQ/gbugV41m67uQ4CDwWLaNRkTb aFA5poKRAYlo9YtZ3YpFyjGKB6MfCQcB2opuSnQ/gbugV41m67uQ4CDwWLaNRkTb
GlsMBNcHnidg15Bsat5HaB7l250ukrI13Uw1MYdDUzaS3gPfw9aC4F2w0p3U+DPH GlsMBNcHnidg15Bsat5HaB7l250ukrI13Uw1MYdDUzaS3gPfw9aC4F2w0p3U+DPH
80/zePxtroR7T4/+rI136Rl+aMXDMOEGCX1TVP8rjuZzuRyUSUKC8Q== 80/zePxtroR7T4/+rI136Rl+aMXDMOEGCX1TVP8rjuZzuRyUSUKC8Q==
-----END RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB
VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV
BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA
aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV
BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP
MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW
C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN
Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm
k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W
jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB
AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a
+ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO +ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO
M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP
-----END CERTIFICATE----- -----END CERTIFICATE-----

View File

@@ -1,15 +1,15 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB
VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV
BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA
aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV
BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP
MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW
C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN
Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm
k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W
jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB
AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a
+ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO +ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO
M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP
-----END CERTIFICATE----- -----END CERTIFICATE-----

View File

@@ -1,48 +1,48 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIICaDCCAdECCQCzfxSsk7yaLjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB MIICaDCCAdECCQCzfxSsk7yaLjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB
VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV
BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA
aW5mLmNvbTAeFw0wNjAzMDExMzA3MzFaFw0wNjAzMzExMzA3MzFaMH4xCzAJBgNV aW5mLmNvbTAeFw0wNjAzMDExMzA3MzFaFw0wNjAzMzExMzA3MzFaMH4xCzAJBgNV
BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExETAPBgNVBAcTCFN0IEpha29iMRww BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExETAPBgNVBAcTCFN0IEpha29iMRww
GgYDVQQKExNBcHBsaWVkIEluZm9ybWF0aWNzMQowCAYDVQQDFAEqMR4wHAYJKoZI GgYDVQQKExNBcHBsaWVkIEluZm9ybWF0aWNzMQowCAYDVQQDFAEqMR4wHAYJKoZI
hvcNAQkBFg9pbmZvQGFwcGluZi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ hvcNAQkBFg9pbmZvQGFwcGluZi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ
AoGBAJHGyXDHyCYoWz+65ltNwwZbhwOGnxr9P1WMATuFJh0bPBZxKbZRdbTm9KhZ AoGBAJHGyXDHyCYoWz+65ltNwwZbhwOGnxr9P1WMATuFJh0bPBZxKbZRdbTm9KhZ
OlvsEIsfgiYdsxURYIqXfEgISYLZcZY0pQwGEOmB+0NeC/+ENSfOlNSthx6zSVlc OlvsEIsfgiYdsxURYIqXfEgISYLZcZY0pQwGEOmB+0NeC/+ENSfOlNSthx6zSVlc
zhJ7+dJOGwepHAiLr1fRuc5jogYLraE+lKTnqAAFfzwvti77AgMBAAEwDQYJKoZI zhJ7+dJOGwepHAiLr1fRuc5jogYLraE+lKTnqAAFfzwvti77AgMBAAEwDQYJKoZI
hvcNAQEFBQADgYEAY/ZoeY1ukkEJX7259NeoVM0oahlulWV0rlCqyaeosOiDORPT hvcNAQEFBQADgYEAY/ZoeY1ukkEJX7259NeoVM0oahlulWV0rlCqyaeosOiDORPT
m6X1w/5MTCf9VyaD1zukoSZ4QqNVjHFXcXidbB7Tgt3yRuZ5PC5LIFCDPv9mgPne m6X1w/5MTCf9VyaD1zukoSZ4QqNVjHFXcXidbB7Tgt3yRuZ5PC5LIFCDPv9mgPne
mUA70yfctNfza2z3ZiQ6NDkW3mZX+1tmxYIrJQIrkVeYeqf1Gh2nyZrUMcE= mUA70yfctNfza2z3ZiQ6NDkW3mZX+1tmxYIrJQIrkVeYeqf1Gh2nyZrUMcE=
-----END CERTIFICATE----- -----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY----- -----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,E7AE93C9E49184EA DEK-Info: DES-EDE3-CBC,E7AE93C9E49184EA
A2IqzNcWs+I5vzV+i+woDk56+yr58eU0Onw8eEvXkLjnSc58JU4327IF7yUbKWdW A2IqzNcWs+I5vzV+i+woDk56+yr58eU0Onw8eEvXkLjnSc58JU4327IF7yUbKWdW
Q7BYGGOkVFiZ7ANOwviDg5SUhxRDWCcW8dS6/p1vfdQ1C3qj2OwJjkpg0aDBIzJn Q7BYGGOkVFiZ7ANOwviDg5SUhxRDWCcW8dS6/p1vfdQ1C3qj2OwJjkpg0aDBIzJn
FzgguT3MF3ama77vxv0S3kOfmCj62MLqPGpj5pQ0/1hefRFbL8oAX8bXUN7/rmGM FzgguT3MF3ama77vxv0S3kOfmCj62MLqPGpj5pQ0/1hefRFbL8oAX8bXUN7/rmGM
Zc0QyzFZv2iQ04dY/6TNclwKPB4H0On4K+8BMs3PRkWA0clCaQaFO2+iwnk3XZfe Zc0QyzFZv2iQ04dY/6TNclwKPB4H0On4K+8BMs3PRkWA0clCaQaFO2+iwnk3XZfe
+MsKUEbLCpAQeYspYv1cw38dCdWq1KTP5aJk+oXgwjfX5cAaPTz74NTqTIsCcaTD +MsKUEbLCpAQeYspYv1cw38dCdWq1KTP5aJk+oXgwjfX5cAaPTz74NTqTIsCcaTD
3vy7ukJYFlDR9Kyo7z8rMazYrKJslhnuRH0BhK9st9McwL957j5tZmrKyraCcmCx 3vy7ukJYFlDR9Kyo7z8rMazYrKJslhnuRH0BhK9st9McwL957j5tZmrKyraCcmCx
dMAGcsis1va3ayYZpIpFqA4EhYrTM+6N8ZRfUap20+b5IQwHfTQDejUhL6rBwy7j dMAGcsis1va3ayYZpIpFqA4EhYrTM+6N8ZRfUap20+b5IQwHfTQDejUhL6rBwy7j
Ti5yD83/itoOMyXq2sV/XWfVD5zk/P5iv22O1EAQMhhnPB9K/I/JhuSGQJfn3cNh Ti5yD83/itoOMyXq2sV/XWfVD5zk/P5iv22O1EAQMhhnPB9K/I/JhuSGQJfn3cNh
ykOUYT0+vDeSeEVa+FVEP1W35G0alTbKbNs5Tb8KxJ3iDJUxokM//SvPXZy9hOVX ykOUYT0+vDeSeEVa+FVEP1W35G0alTbKbNs5Tb8KxJ3iDJUxokM//SvPXZy9hOVX
Y05imB04J15DaGbAHlNzunhuJi7121WV/JRXZRW9diE6hwpD8rwqi3FMuRUmy7U9 Y05imB04J15DaGbAHlNzunhuJi7121WV/JRXZRW9diE6hwpD8rwqi3FMuRUmy7U9
aFA5poKRAYlo9YtZ3YpFyjGKB6MfCQcB2opuSnQ/gbugV41m67uQ4CDwWLaNRkTb aFA5poKRAYlo9YtZ3YpFyjGKB6MfCQcB2opuSnQ/gbugV41m67uQ4CDwWLaNRkTb
GlsMBNcHnidg15Bsat5HaB7l250ukrI13Uw1MYdDUzaS3gPfw9aC4F2w0p3U+DPH GlsMBNcHnidg15Bsat5HaB7l250ukrI13Uw1MYdDUzaS3gPfw9aC4F2w0p3U+DPH
80/zePxtroR7T4/+rI136Rl+aMXDMOEGCX1TVP8rjuZzuRyUSUKC8Q== 80/zePxtroR7T4/+rI136Rl+aMXDMOEGCX1TVP8rjuZzuRyUSUKC8Q==
-----END RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB
VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV
BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA
aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV
BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP
MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW
C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN
Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm
k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W
jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB
AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a
+ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO +ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO
M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP
-----END CERTIFICATE----- -----END CERTIFICATE-----

View File

@@ -1,8 +1,8 @@
# #
# sample.vmsbuild # sample.vmsbuild
# #
# $Id: //poco/Main/template/sample.vmsbuild#3 $ # $Id: //poco/Main/template/sample.vmsbuild#3 $
# #
EXE=download EXE=download
download download
<SourceFilesHere> <SourceFilesHere>

View File

@@ -1,145 +1,145 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.10" Version="7.10"
Name="download" Name="download"
ProjectGUID="{9BDC3455-0F7A-46b5-8EA5-9AA291419ED4}" ProjectGUID="{9BDC3455-0F7A-46b5-8EA5-9AA291419ED4}"
Keyword="Win32Proj"> Keyword="Win32Proj">
<Platforms> <Platforms>
<Platform <Platform
Name="Win32"/> Name="Win32"/>
</Platforms> </Platforms>
<Configurations> <Configurations>
<Configuration <Configuration
Name="debug_shared|Win32" Name="debug_shared|Win32"
OutputDirectory="obj\debug_shared" OutputDirectory="obj\debug_shared"
IntermediateDirectory="obj\debug_shared" IntermediateDirectory="obj\debug_shared"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2"> CharacterSet="2">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include" AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
MinimalRebuild="TRUE" MinimalRebuild="TRUE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
BufferSecurityCheck="TRUE" BufferSecurityCheck="TRUE"
TreatWChar_tAsBuiltInType="TRUE" TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="TRUE" ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE" RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/> DebugInformationFormat="4"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="PocoFoundationd.lib PocoXMLd.lib PocoNetd.lib PocoUtild.lib PocoNetSSLd.lib" AdditionalDependencies="PocoFoundationd.lib PocoXMLd.lib PocoNetd.lib PocoUtild.lib PocoNetSSLd.lib"
OutputFile="bin/downloadd.exe" OutputFile="bin/downloadd.exe"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib" AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="TRUE" GenerateDebugInformation="TRUE"
ProgramDatabaseFile="bin/downloadd.pdb" ProgramDatabaseFile="bin/downloadd.pdb"
SubSystem="1" SubSystem="1"
TargetMachine="1"/> TargetMachine="1"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCPostBuildEventTool"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool"/> Name="VCResourceCompilerTool"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool <Tool
Name="VCManagedWrapperGeneratorTool"/> Name="VCManagedWrapperGeneratorTool"/>
<Tool <Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
<Configuration <Configuration
Name="release_shared|Win32" Name="release_shared|Win32"
OutputDirectory="obj\release_shared" OutputDirectory="obj\release_shared"
IntermediateDirectory="obj\release_shared" IntermediateDirectory="obj\release_shared"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2"> CharacterSet="2">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="4" Optimization="4"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
EnableIntrinsicFunctions="TRUE" EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="TRUE" OmitFramePointers="TRUE"
OptimizeForWindowsApplication="TRUE" OptimizeForWindowsApplication="TRUE"
AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include" AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="FALSE" BufferSecurityCheck="FALSE"
TreatWChar_tAsBuiltInType="TRUE" TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="TRUE" ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE" RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/> DebugInformationFormat="3"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="PocoFoundation.lib PocoXML.lib PocoNet.lib PocoUtil.lib PocoNetSSL.lib" AdditionalDependencies="PocoFoundation.lib PocoXML.lib PocoNet.lib PocoUtil.lib PocoNetSSL.lib"
OutputFile="bin/download.exe" OutputFile="bin/download.exe"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\lib" AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="FALSE" GenerateDebugInformation="FALSE"
ProgramDatabaseFile="" ProgramDatabaseFile=""
SubSystem="1" SubSystem="1"
OptimizeReferences="2" OptimizeReferences="2"
EnableCOMDATFolding="2" EnableCOMDATFolding="2"
TargetMachine="1"/> TargetMachine="1"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCPostBuildEventTool"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool"/> Name="VCResourceCompilerTool"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool <Tool
Name="VCManagedWrapperGeneratorTool"/> Name="VCManagedWrapperGeneratorTool"/>
<Tool <Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>
<Files> <Files>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\download.cpp"> RelativePath=".\src\download.cpp">
</File> </File>
</Filter> </Filter>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>
</VisualStudioProject> </VisualStudioProject>

View File

@@ -1,210 +1,210 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8,00" Version="8,00"
Name="download" Name="download"
ProjectGUID="{22F6B2E6-A532-4156-A49A-835A21BFF3F6}" ProjectGUID="{22F6B2E6-A532-4156-A49A-835A21BFF3F6}"
RootNamespace="download" RootNamespace="download"
Keyword="Win32Proj" Keyword="Win32Proj"
> >
<Platforms> <Platforms>
<Platform <Platform
Name="Win32" Name="Win32"
/> />
</Platforms> </Platforms>
<ToolFiles> <ToolFiles>
</ToolFiles> </ToolFiles>
<Configurations> <Configurations>
<Configuration <Configuration
Name="debug_shared|Win32" Name="debug_shared|Win32"
OutputDirectory="obj\debug_shared" OutputDirectory="obj\debug_shared"
IntermediateDirectory="obj\debug_shared" IntermediateDirectory="obj\debug_shared"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2" CharacterSet="2"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
/> />
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool" Name="VCWebServiceProxyGeneratorTool"
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include" AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
BufferSecurityCheck="true" BufferSecurityCheck="true"
TreatWChar_tAsBuiltInType="true" TreatWChar_tAsBuiltInType="true"
ForceConformanceInForLoopScope="true" ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true" RuntimeTypeInfo="true"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="4" DebugInformationFormat="4"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"
/> />
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="PocoFoundationd.lib PocoXMLd.lib PocoNetd.lib PocoNetSSLd.lib PocoUtild.lib" AdditionalDependencies="PocoFoundationd.lib PocoXMLd.lib PocoNetd.lib PocoNetSSLd.lib PocoUtild.lib"
OutputFile="bin/downloadd.exe" OutputFile="bin/downloadd.exe"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib" AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile="bin/downloadd.pdb" ProgramDatabaseFile="bin/downloadd.pdb"
SubSystem="1" SubSystem="1"
TargetMachine="1" TargetMachine="1"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
/> />
<Tool <Tool
Name="VCManifestTool" Name="VCManifestTool"
/> />
<Tool <Tool
Name="VCXDCMakeTool" Name="VCXDCMakeTool"
/> />
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
/> />
<Tool <Tool
Name="VCFxCopTool" Name="VCFxCopTool"
/> />
<Tool <Tool
Name="VCAppVerifierTool" Name="VCAppVerifierTool"
/> />
<Tool <Tool
Name="VCWebDeploymentTool" Name="VCWebDeploymentTool"
/> />
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="release_shared|Win32" Name="release_shared|Win32"
OutputDirectory="obj\release_shared" OutputDirectory="obj\release_shared"
IntermediateDirectory="obj\release_shared" IntermediateDirectory="obj\release_shared"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2" CharacterSet="2"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
/> />
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool" Name="VCWebServiceProxyGeneratorTool"
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="4" Optimization="4"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="true" OmitFramePointers="true"
AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include" AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Net\include;..\..\..\Util\include;..\..\..\NetSSL_OpenSSL\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
StringPooling="true" StringPooling="true"
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="false" BufferSecurityCheck="false"
TreatWChar_tAsBuiltInType="true" TreatWChar_tAsBuiltInType="true"
ForceConformanceInForLoopScope="true" ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true" RuntimeTypeInfo="true"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"
/> />
<Tool <Tool
Name="VCResourceCompilerTool" Name="VCResourceCompilerTool"
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="PocoFoundation.lib PocoXML.lib PocoNet.lib PocoNetSSL.lib PocoUtil.lib" AdditionalDependencies="PocoFoundation.lib PocoXML.lib PocoNet.lib PocoNetSSL.lib PocoUtil.lib"
OutputFile="bin/download.exe" OutputFile="bin/download.exe"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\lib" AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="false" GenerateDebugInformation="false"
ProgramDatabaseFile="" ProgramDatabaseFile=""
SubSystem="1" SubSystem="1"
OptimizeReferences="2" OptimizeReferences="2"
EnableCOMDATFolding="2" EnableCOMDATFolding="2"
TargetMachine="1" TargetMachine="1"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
/> />
<Tool <Tool
Name="VCManifestTool" Name="VCManifestTool"
/> />
<Tool <Tool
Name="VCXDCMakeTool" Name="VCXDCMakeTool"
/> />
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
/> />
<Tool <Tool
Name="VCFxCopTool" Name="VCFxCopTool"
/> />
<Tool <Tool
Name="VCAppVerifierTool" Name="VCAppVerifierTool"
/> />
<Tool <Tool
Name="VCWebDeploymentTool" Name="VCWebDeploymentTool"
/> />
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>
<Files> <Files>
<Filter <Filter
Name="Source Files" Name="Source Files"
> >
<File <File
RelativePath=".\src\download.cpp" RelativePath=".\src\download.cpp"
> >
</File> </File>
</Filter> </Filter>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>
</VisualStudioProject> </VisualStudioProject>

View File

@@ -1,15 +1,15 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB
VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV
BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA
aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV
BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP
MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW
C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN
Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm
k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W
jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB
AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a
+ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO +ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO
M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP
-----END CERTIFICATE----- -----END CERTIFICATE-----

View File

@@ -1,29 +1,29 @@
Microsoft Visual Studio Solution File, Format Version 8.00 Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HTTPSTimeServer", "HTTPSTimeServer\HTTPSTimeServer_vs71.vcproj", "{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HTTPSTimeServer", "HTTPSTimeServer\HTTPSTimeServer_vs71.vcproj", "{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "download", "download\download_vs71.vcproj", "{22F6B2E6-A532-4156-A49A-835A21BFF3F6}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "download", "download\download_vs71.vcproj", "{22F6B2E6-A532-4156-A49A-835A21BFF3F6}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfiguration) = preSolution
debug_shared = debug_shared debug_shared = debug_shared
release_shared = release_shared release_shared = release_shared
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution GlobalSection(ProjectConfiguration) = postSolution
{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.debug_shared.ActiveCfg = debug_shared|Win32 {7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.debug_shared.ActiveCfg = debug_shared|Win32
{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.debug_shared.Build.0 = debug_shared|Win32 {7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.debug_shared.Build.0 = debug_shared|Win32
{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.release_shared.ActiveCfg = release_shared|Win32 {7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.release_shared.ActiveCfg = release_shared|Win32
{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.release_shared.Build.0 = release_shared|Win32 {7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.release_shared.Build.0 = release_shared|Win32
{22F6B2E6-A532-4156-A49A-835A21BFF3F6}.debug_shared.ActiveCfg = debug_shared|Win32 {22F6B2E6-A532-4156-A49A-835A21BFF3F6}.debug_shared.ActiveCfg = debug_shared|Win32
{22F6B2E6-A532-4156-A49A-835A21BFF3F6}.debug_shared.Build.0 = debug_shared|Win32 {22F6B2E6-A532-4156-A49A-835A21BFF3F6}.debug_shared.Build.0 = debug_shared|Win32
{22F6B2E6-A532-4156-A49A-835A21BFF3F6}.release_shared.ActiveCfg = release_shared|Win32 {22F6B2E6-A532-4156-A49A-835A21BFF3F6}.release_shared.ActiveCfg = release_shared|Win32
{22F6B2E6-A532-4156-A49A-835A21BFF3F6}.release_shared.Build.0 = release_shared|Win32 {22F6B2E6-A532-4156-A49A-835A21BFF3F6}.release_shared.Build.0 = release_shared|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,25 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005 # Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HTTPSTimeServer", "HTTPSTimeServer\HTTPSTimeServer_vs80.vcproj", "{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HTTPSTimeServer", "HTTPSTimeServer\HTTPSTimeServer_vs80.vcproj", "{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "download", "download\download_vs80.vcproj", "{22F6B2E6-A532-4156-A49A-835A21BFF3F6}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "download", "download\download_vs80.vcproj", "{22F6B2E6-A532-4156-A49A-835A21BFF3F6}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
debug_shared|Win32 = debug_shared|Win32 debug_shared|Win32 = debug_shared|Win32
release_shared|Win32 = release_shared|Win32 release_shared|Win32 = release_shared|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 {7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.debug_shared|Win32.Build.0 = debug_shared|Win32 {7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.debug_shared|Win32.Build.0 = debug_shared|Win32
{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.release_shared|Win32.ActiveCfg = release_shared|Win32 {7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.release_shared|Win32.ActiveCfg = release_shared|Win32
{7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.release_shared|Win32.Build.0 = release_shared|Win32 {7C4285ED-F0BC-4CBA-B1F0-61FCB7FA26C4}.release_shared|Win32.Build.0 = release_shared|Win32
{22F6B2E6-A532-4156-A49A-835A21BFF3F6}.debug_shared|Win32.ActiveCfg = debug_shared|Win32 {22F6B2E6-A532-4156-A49A-835A21BFF3F6}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
{22F6B2E6-A532-4156-A49A-835A21BFF3F6}.debug_shared|Win32.Build.0 = debug_shared|Win32 {22F6B2E6-A532-4156-A49A-835A21BFF3F6}.debug_shared|Win32.Build.0 = debug_shared|Win32
{22F6B2E6-A532-4156-A49A-835A21BFF3F6}.release_shared|Win32.ActiveCfg = release_shared|Win32 {22F6B2E6-A532-4156-A49A-835A21BFF3F6}.release_shared|Win32.ActiveCfg = release_shared|Win32
{22F6B2E6-A532-4156-A49A-835A21BFF3F6}.release_shared|Win32.Build.0 = release_shared|Win32 {22F6B2E6-A532-4156-A49A-835A21BFF3F6}.release_shared|Win32.Build.0 = release_shared|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,54 +1,54 @@
// //
// AcceptCertificateHandler.cpp // AcceptCertificateHandler.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/AcceptCertificateHandler.cpp#2 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/AcceptCertificateHandler.cpp#2 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: AcceptCertificateHandler // Module: AcceptCertificateHandler
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/AcceptCertificateHandler.h" #include "Poco/Net/AcceptCertificateHandler.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
AcceptCertificateHandler::AcceptCertificateHandler(bool server):InvalidCertificateHandler(server) AcceptCertificateHandler::AcceptCertificateHandler(bool server):InvalidCertificateHandler(server)
{ {
} }
AcceptCertificateHandler::~AcceptCertificateHandler() AcceptCertificateHandler::~AcceptCertificateHandler()
{ {
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,66 +1,66 @@
// //
// CertificateHandlerFactory.cpp // CertificateHandlerFactory.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/CertificateHandlerFactory.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/CertificateHandlerFactory.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: CertificateHandlerFactory // Module: CertificateHandlerFactory
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/CertificateHandlerFactory.h" #include "Poco/Net/CertificateHandlerFactory.h"
#include "Poco/Net/SSLManager.h" #include "Poco/Net/SSLManager.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
CertificateHandlerFactory::CertificateHandlerFactory() CertificateHandlerFactory::CertificateHandlerFactory()
{ {
} }
CertificateHandlerFactory::~CertificateHandlerFactory() CertificateHandlerFactory::~CertificateHandlerFactory()
{ {
} }
CertificateHandlerFactoryRegistrar::CertificateHandlerFactoryRegistrar(const std::string& name, CertificateHandlerFactory* pFactory) CertificateHandlerFactoryRegistrar::CertificateHandlerFactoryRegistrar(const std::string& name, CertificateHandlerFactory* pFactory)
{ {
SSLManager::instance().certificateHandlerFactoryMgr().setFactory(name, pFactory); SSLManager::instance().certificateHandlerFactoryMgr().setFactory(name, pFactory);
} }
CertificateHandlerFactoryRegistrar::~CertificateHandlerFactoryRegistrar() CertificateHandlerFactoryRegistrar::~CertificateHandlerFactoryRegistrar()
{ {
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,90 +1,90 @@
// //
// CertificateHandlerFactoryMgr.cpp // CertificateHandlerFactoryMgr.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/CertificateHandlerFactoryMgr.cpp#2 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/CertificateHandlerFactoryMgr.cpp#2 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: CertificateHandlerFactoryMgr // Module: CertificateHandlerFactoryMgr
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#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"
namespace Poco { namespace Poco {
namespace Net { 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>());
} }
CertificateHandlerFactoryMgr::~CertificateHandlerFactoryMgr() CertificateHandlerFactoryMgr::~CertificateHandlerFactoryMgr()
{ {
} }
void CertificateHandlerFactoryMgr::setFactory(const std::string& name, CertificateHandlerFactory* pFactory) void CertificateHandlerFactoryMgr::setFactory(const std::string& name, CertificateHandlerFactory* pFactory)
{ {
bool success = _factories.insert(make_pair(name, Poco::SharedPtr<CertificateHandlerFactory>(pFactory))).second; bool success = _factories.insert(make_pair(name, Poco::SharedPtr<CertificateHandlerFactory>(pFactory))).second;
if (!success) if (!success)
delete pFactory; delete pFactory;
poco_assert(success); poco_assert(success);
} }
bool CertificateHandlerFactoryMgr::hasFactory(const std::string& name) const bool CertificateHandlerFactoryMgr::hasFactory(const std::string& name) const
{ {
return _factories.find(name) != _factories.end(); return _factories.find(name) != _factories.end();
} }
const CertificateHandlerFactory* CertificateHandlerFactoryMgr::getFactory(const std::string& name) const const CertificateHandlerFactory* CertificateHandlerFactoryMgr::getFactory(const std::string& name) const
{ {
FactoriesMap::const_iterator it = _factories.find(name); FactoriesMap::const_iterator it = _factories.find(name);
if (it != _factories.end()) if (it != _factories.end())
return it->second; return it->second;
else else
return 0; return 0;
} }
void CertificateHandlerFactoryMgr::removeFactory(const std::string& name) void CertificateHandlerFactoryMgr::removeFactory(const std::string& name)
{ {
_factories.erase(name); _factories.erase(name);
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,74 +1,74 @@
// //
// ConsoleCertificateHandler.cpp // ConsoleCertificateHandler.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/ConsoleCertificateHandler.cpp#2 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/ConsoleCertificateHandler.cpp#2 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: ConsoleCertificateHandler // Module: ConsoleCertificateHandler
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/ConsoleCertificateHandler.h" #include "Poco/Net/ConsoleCertificateHandler.h"
#include <iostream> #include <iostream>
namespace Poco { namespace Poco {
namespace Net { namespace Net {
ConsoleCertificateHandler::ConsoleCertificateHandler(bool server):InvalidCertificateHandler(server) ConsoleCertificateHandler::ConsoleCertificateHandler(bool server):InvalidCertificateHandler(server)
{ {
} }
ConsoleCertificateHandler::~ConsoleCertificateHandler() ConsoleCertificateHandler::~ConsoleCertificateHandler()
{ {
} }
void ConsoleCertificateHandler::onInvalidCertificate(const void*, VerificationErrorArgs& errorCert) void ConsoleCertificateHandler::onInvalidCertificate(const void*, VerificationErrorArgs& errorCert)
{ {
const X509Certificate& aCert = errorCert.certificate(); const X509Certificate& aCert = errorCert.certificate();
std::cout << " Certificate:\n"; std::cout << " Certificate:\n";
std::cout << "----------------\n"; std::cout << "----------------\n";
std::cout << " IssuerName: \t" << aCert.issuerName() << "\n"; std::cout << " IssuerName: \t" << aCert.issuerName() << "\n";
std::cout << " SubjectName:\t" << aCert.subjectName() << "\n\n"; std::cout << " SubjectName:\t" << aCert.subjectName() << "\n\n";
std::cout << "The certificate yielded the error: " << errorCert.errorMessage() << "\n\n"; std::cout << "The certificate yielded the error: " << errorCert.errorMessage() << "\n\n";
std::cout << "The error occurred at in the certificate chain at position " << errorCert.errorDepth() << "\n"; std::cout << "The error occurred at in the certificate chain at position " << errorCert.errorDepth() << "\n";
std::cout << "Accept the certificate? (y,n)"; std::cout << "Accept the certificate? (y,n)";
char c; char c;
std::cin >> c; std::cin >> c;
if (c == 'y' || c == 'Y') if (c == 'y' || c == 'Y')
errorCert.setIgnoreError(true); errorCert.setIgnoreError(true);
else else
errorCert.setIgnoreError(false); errorCert.setIgnoreError(false);
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,108 +1,108 @@
// //
// HTTPSClientSession.cpp // HTTPSClientSession.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/HTTPSClientSession.cpp#3 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/HTTPSClientSession.cpp#3 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: HTTPSClient // Package: HTTPSClient
// Module: HTTPSClientSession // Module: HTTPSClientSession
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/HTTPSClientSession.h" #include "Poco/Net/HTTPSClientSession.h"
#include "Poco/Net/SecureStreamSocket.h" #include "Poco/Net/SecureStreamSocket.h"
#include "Poco/Net/SecureStreamSocketImpl.h" #include "Poco/Net/SecureStreamSocketImpl.h"
#include "Poco/Net/HTTPRequest.h" #include "Poco/Net/HTTPRequest.h"
#include "Poco/Net/HTTPResponse.h" #include "Poco/Net/HTTPResponse.h"
#include "Poco/Net/HTTPHeaderStream.h" #include "Poco/Net/HTTPHeaderStream.h"
#include "Poco/Net/HTTPStream.h" #include "Poco/Net/HTTPStream.h"
#include "Poco/Net/HTTPFixedLengthStream.h" #include "Poco/Net/HTTPFixedLengthStream.h"
#include "Poco/Net/HTTPChunkedStream.h" #include "Poco/Net/HTTPChunkedStream.h"
#include "Poco/Net/NetException.h" #include "Poco/Net/NetException.h"
#include "Poco/NumberFormatter.h" #include "Poco/NumberFormatter.h"
using Poco::NumberFormatter; using Poco::NumberFormatter;
using Poco::IllegalStateException; using Poco::IllegalStateException;
namespace Poco { namespace Poco {
namespace Net { namespace Net {
HTTPSClientSession::HTTPSClientSession(): HTTPSClientSession::HTTPSClientSession():
HTTPClientSession(SecureStreamSocket()) HTTPClientSession(SecureStreamSocket())
{ {
setPort(Utility::HTTPS_PORT); setPort(Utility::HTTPS_PORT);
} }
HTTPSClientSession::HTTPSClientSession(const SecureStreamSocket& socket): HTTPSClientSession::HTTPSClientSession(const SecureStreamSocket& socket):
HTTPClientSession(socket) HTTPClientSession(socket)
{ {
setPort(Utility::HTTPS_PORT); setPort(Utility::HTTPS_PORT);
} }
HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 port): HTTPSClientSession::HTTPSClientSession(const std::string& host, Poco::UInt16 port):
HTTPClientSession(SecureStreamSocket()) HTTPClientSession(SecureStreamSocket())
{ {
setHost(host); setHost(host);
setPort(port); setPort(port);
} }
HTTPSClientSession::~HTTPSClientSession() HTTPSClientSession::~HTTPSClientSession()
{ {
} }
std::string HTTPSClientSession::getHostInfo() const std::string HTTPSClientSession::getHostInfo() const
{ {
std::string result("https://"); std::string result("https://");
result.append(getHost()); result.append(getHost());
result.append(":"); result.append(":");
result.append(NumberFormatter::format(getPort())); result.append(NumberFormatter::format(getPort()));
return result; return result;
} }
void HTTPSClientSession::connect(const SocketAddress& address) void HTTPSClientSession::connect(const SocketAddress& address)
{ {
if (!getProxyHost().empty()) if (!getProxyHost().empty())
{ {
StreamSocket& aSock = socket(); StreamSocket& aSock = socket();
SecureStreamSocketImpl* pImplSock = dynamic_cast<SecureStreamSocketImpl*>(aSock.impl()); SecureStreamSocketImpl* pImplSock = dynamic_cast<SecureStreamSocketImpl*>(aSock.impl());
poco_check_ptr (pImplSock); poco_check_ptr (pImplSock);
pImplSock->setTunnelEndPoint(getHost(), getPort()); pImplSock->setTunnelEndPoint(getHost(), getPort());
} }
HTTPSession::connect(address); HTTPSession::connect(address);
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,77 +1,77 @@
// //
// HTTPSSessionInstantiator.cpp // HTTPSSessionInstantiator.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/HTTPSSessionInstantiator.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/HTTPSSessionInstantiator.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: HTTPSClient // Package: HTTPSClient
// Module: HTTPSSessionInstantiator // Module: HTTPSSessionInstantiator
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/HTTPSSessionInstantiator.h" #include "Poco/Net/HTTPSSessionInstantiator.h"
#include "Poco/Net/HTTPSessionFactory.h" #include "Poco/Net/HTTPSessionFactory.h"
#include "Poco/Net/HTTPSClientSession.h" #include "Poco/Net/HTTPSClientSession.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
HTTPSSessionInstantiator::HTTPSSessionInstantiator() HTTPSSessionInstantiator::HTTPSSessionInstantiator()
{ {
} }
HTTPSSessionInstantiator::~HTTPSSessionInstantiator() 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; return pSession;
} }
void HTTPSSessionInstantiator::registerInstantiator() void HTTPSSessionInstantiator::registerInstantiator()
{ {
HTTPSessionFactory::defaultFactory().registerProtocol("https", new HTTPSSessionInstantiator); HTTPSessionFactory::defaultFactory().registerProtocol("https", new HTTPSSessionInstantiator);
} }
void HTTPSSessionInstantiator::unregisterInstantiator() void HTTPSSessionInstantiator::unregisterInstantiator()
{ {
HTTPSessionFactory::defaultFactory().unregisterProtocol("https"); HTTPSessionFactory::defaultFactory().unregisterProtocol("https");
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,128 +1,128 @@
// //
// HTTPSStreamFactory.cpp // HTTPSStreamFactory.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/HTTPSStreamFactory.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/HTTPSStreamFactory.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: HTTPSClient // Package: HTTPSClient
// Module: HTTPSStreamFactory // Module: HTTPSStreamFactory
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/HTTPSStreamFactory.h" #include "Poco/Net/HTTPSStreamFactory.h"
#include "Poco/Net/HTTPSClientSession.h" #include "Poco/Net/HTTPSClientSession.h"
#include "Poco/Net/HTTPIOStream.h" #include "Poco/Net/HTTPIOStream.h"
#include "Poco/Net/HTTPRequest.h" #include "Poco/Net/HTTPRequest.h"
#include "Poco/Net/HTTPResponse.h" #include "Poco/Net/HTTPResponse.h"
#include "Poco/Net/NetException.h" #include "Poco/Net/NetException.h"
#include "Poco/URI.h" #include "Poco/URI.h"
#include "Poco/URIStreamOpener.h" #include "Poco/URIStreamOpener.h"
#include "Poco/UnbufferedStreamBuf.h" #include "Poco/UnbufferedStreamBuf.h"
using Poco::URIStreamFactory; using Poco::URIStreamFactory;
using Poco::URI; using Poco::URI;
using Poco::URIStreamOpener; using Poco::URIStreamOpener;
using Poco::UnbufferedStreamBuf; using Poco::UnbufferedStreamBuf;
namespace Poco { namespace Poco {
namespace Net { namespace Net {
HTTPSStreamFactory::HTTPSStreamFactory(): HTTPSStreamFactory::HTTPSStreamFactory():
_proxyPort(HTTPSession::HTTP_PORT) _proxyPort(HTTPSession::HTTP_PORT)
{ {
} }
HTTPSStreamFactory::HTTPSStreamFactory(const std::string& proxyHost, Poco::UInt16 proxyPort): HTTPSStreamFactory::HTTPSStreamFactory(const std::string& proxyHost, Poco::UInt16 proxyPort):
_proxyHost(proxyHost), _proxyHost(proxyHost),
_proxyPort(proxyPort) _proxyPort(proxyPort)
{ {
} }
HTTPSStreamFactory::~HTTPSStreamFactory() HTTPSStreamFactory::~HTTPSStreamFactory()
{ {
} }
std::istream* HTTPSStreamFactory::open(const URI& uri) std::istream* HTTPSStreamFactory::open(const URI& uri)
{ {
poco_assert (uri.getScheme() == "https"); poco_assert (uri.getScheme() == "https");
URI resolvedURI(uri); URI resolvedURI(uri);
HTTPClientSession* pSession = 0; HTTPClientSession* pSession = 0;
try try
{ {
int redirects = 0; int redirects = 0;
do do
{ {
pSession = new HTTPSClientSession(resolvedURI.getHost(), resolvedURI.getPort()); pSession = new HTTPSClientSession(resolvedURI.getHost(), resolvedURI.getPort());
pSession->setProxy(_proxyHost, _proxyPort); pSession->setProxy(_proxyHost, _proxyPort);
std::string path = resolvedURI.getPathAndQuery(); std::string path = resolvedURI.getPathAndQuery();
if (path.empty()) path = "/"; if (path.empty()) path = "/";
HTTPRequest req(HTTPRequest::HTTP_GET, path, HTTPMessage::HTTP_1_1); 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);
bool moved = (res.getStatus() == HTTPResponse::HTTP_MOVED_PERMANENTLY || bool moved = (res.getStatus() == HTTPResponse::HTTP_MOVED_PERMANENTLY ||
res.getStatus() == HTTPResponse::HTTP_FOUND || res.getStatus() == HTTPResponse::HTTP_FOUND ||
res.getStatus() == HTTPResponse::HTTP_SEE_OTHER); res.getStatus() == HTTPResponse::HTTP_SEE_OTHER);
if (moved) if (moved)
{ {
resolvedURI.resolve(res.get("Location")); resolvedURI.resolve(res.get("Location"));
delete pSession; delete pSession;
++redirects; ++redirects;
} }
else if (res.getStatus() == HTTPResponse::HTTP_OK) else if (res.getStatus() == HTTPResponse::HTTP_OK)
{ {
return new HTTPResponseStream(rs, pSession); return new HTTPResponseStream(rs, pSession);
} }
else throw HTTPException(res.getReason(), uri.toString()); else throw HTTPException(res.getReason(), uri.toString());
} }
while (redirects < MAX_REDIRECTS); while (redirects < MAX_REDIRECTS);
throw HTTPException("Too many redirects", uri.toString()); throw HTTPException("Too many redirects", uri.toString());
} }
catch (...) catch (...)
{ {
delete pSession; delete pSession;
throw; throw;
} }
} }
void HTTPSStreamFactory::registerFactory() void HTTPSStreamFactory::registerFactory()
{ {
std::string https("https"); std::string https("https");
URIStreamOpener::defaultOpener().registerStreamFactory(https, new HTTPSStreamFactory); URIStreamOpener::defaultOpener().registerStreamFactory(https, new HTTPSStreamFactory);
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,67 +1,67 @@
// //
// InvalidCertificateHandler.cpp // InvalidCertificateHandler.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/InvalidCertificateHandler.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/InvalidCertificateHandler.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: InvalidCertificateHandler // Module: InvalidCertificateHandler
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/InvalidCertificateHandler.h" #include "Poco/Net/InvalidCertificateHandler.h"
#include "Poco/Net/SSLManager.h" #include "Poco/Net/SSLManager.h"
#include "Poco/Delegate.h" #include "Poco/Delegate.h"
using Poco::Delegate; using Poco::Delegate;
namespace Poco { namespace Poco {
namespace Net { namespace Net {
InvalidCertificateHandler::InvalidCertificateHandler(bool handleErrorsOnServerSide): _handleErrorsOnServerSide(handleErrorsOnServerSide) InvalidCertificateHandler::InvalidCertificateHandler(bool handleErrorsOnServerSide): _handleErrorsOnServerSide(handleErrorsOnServerSide)
{ {
if (_handleErrorsOnServerSide) if (_handleErrorsOnServerSide)
SSLManager::instance().ServerVerificationError += Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate); SSLManager::instance().ServerVerificationError += Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate);
else else
SSLManager::instance().ClientVerificationError += Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate); SSLManager::instance().ClientVerificationError += Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate);
} }
InvalidCertificateHandler::~InvalidCertificateHandler() InvalidCertificateHandler::~InvalidCertificateHandler()
{ {
if (_handleErrorsOnServerSide) if (_handleErrorsOnServerSide)
SSLManager::instance().ServerVerificationError -= Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate); SSLManager::instance().ServerVerificationError -= Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate);
else else
SSLManager::instance().ClientVerificationError -= Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate); SSLManager::instance().ClientVerificationError -= Delegate<InvalidCertificateHandler, VerificationErrorArgs>(this, &InvalidCertificateHandler::onInvalidCertificate);
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,62 +1,62 @@
// //
// KeyConsoleHandler.cpp // KeyConsoleHandler.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/KeyConsoleHandler.cpp#2 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/KeyConsoleHandler.cpp#2 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: KeyConsoleHandler // Module: KeyConsoleHandler
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/KeyConsoleHandler.h" #include "Poco/Net/KeyConsoleHandler.h"
#include <iostream> #include <iostream>
namespace Poco { namespace Poco {
namespace Net { namespace Net {
KeyConsoleHandler::KeyConsoleHandler(bool server):PrivateKeyPassphraseHandler(server) KeyConsoleHandler::KeyConsoleHandler(bool server):PrivateKeyPassphraseHandler(server)
{ {
} }
KeyConsoleHandler::~KeyConsoleHandler() KeyConsoleHandler::~KeyConsoleHandler()
{ {
} }
void KeyConsoleHandler::onPrivateKeyRequested(const void* pSender, std::string& privateKey) void KeyConsoleHandler::onPrivateKeyRequested(const void* pSender, std::string& privateKey)
{ {
std::cout << "Please enter the pass-phrase for the private key: "; std::cout << "Please enter the pass-phrase for the private key: ";
std::cin >> privateKey; std::cin >> privateKey;
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,75 +1,75 @@
// //
// KeyFileHandler.cpp // KeyFileHandler.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/KeyFileHandler.cpp#2 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/KeyFileHandler.cpp#2 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: KeyFileHandler // Module: KeyFileHandler
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#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/LayeredConfiguration.h"
#include "Poco/Util/Application.h" #include "Poco/Util/Application.h"
#include "Poco/Util/OptionException.h" #include "Poco/Util/OptionException.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
const std::string KeyFileHandler::CFG_PRIV_KEY_FILE("privateKeyPassphraseHandler.options.password"); const std::string KeyFileHandler::CFG_PRIV_KEY_FILE("privateKeyPassphraseHandler.options.password");
KeyFileHandler::KeyFileHandler(bool server):PrivateKeyPassphraseHandler(server) KeyFileHandler::KeyFileHandler(bool server):PrivateKeyPassphraseHandler(server)
{ {
} }
KeyFileHandler::~KeyFileHandler() 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(); Poco::Util::LayeredConfiguration& config = Poco::Util::Application::instance().config();
std::string prefix = serverSide() ? SSLManager::CFG_SERVER_PREFIX : SSLManager::CFG_CLIENT_PREFIX; std::string prefix = serverSide() ? SSLManager::CFG_SERVER_PREFIX : SSLManager::CFG_CLIENT_PREFIX;
if (!config.hasProperty(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); 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);
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,66 +1,66 @@
// //
// PrivateKeyFactory.cpp // PrivateKeyFactory.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/PrivateKeyFactory.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/PrivateKeyFactory.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: PrivateKeyFactory // Module: PrivateKeyFactory
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/PrivateKeyFactory.h" #include "Poco/Net/PrivateKeyFactory.h"
#include "Poco/Net/SSLManager.h" #include "Poco/Net/SSLManager.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
PrivateKeyFactory::PrivateKeyFactory() PrivateKeyFactory::PrivateKeyFactory()
{ {
} }
PrivateKeyFactory::~PrivateKeyFactory() PrivateKeyFactory::~PrivateKeyFactory()
{ {
} }
PrivateKeyFactoryRegistrar::PrivateKeyFactoryRegistrar(const std::string& name, PrivateKeyFactory* pFactory) PrivateKeyFactoryRegistrar::PrivateKeyFactoryRegistrar(const std::string& name, PrivateKeyFactory* pFactory)
{ {
SSLManager::instance().privateKeyFactoryMgr().setFactory(name, pFactory); SSLManager::instance().privateKeyFactoryMgr().setFactory(name, pFactory);
} }
PrivateKeyFactoryRegistrar::~PrivateKeyFactoryRegistrar() PrivateKeyFactoryRegistrar::~PrivateKeyFactoryRegistrar()
{ {
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,89 +1,89 @@
// //
// PrivateKeyFactoryMgr.cpp // PrivateKeyFactoryMgr.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/PrivateKeyFactoryMgr.cpp#2 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/PrivateKeyFactoryMgr.cpp#2 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: PrivateKeyFactoryMgr // Module: PrivateKeyFactoryMgr
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/PrivateKeyFactoryMgr.h" #include "Poco/Net/PrivateKeyFactoryMgr.h"
#include "Poco/Net/KeyFileHandler.h" #include "Poco/Net/KeyFileHandler.h"
#include "Poco/Net/KeyConsoleHandler.h" #include "Poco/Net/KeyConsoleHandler.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
PrivateKeyFactoryMgr::PrivateKeyFactoryMgr() PrivateKeyFactoryMgr::PrivateKeyFactoryMgr()
{ {
setFactory("KeyFileHandler", new PrivateKeyFactoryImpl<KeyFileHandler>()); setFactory("KeyFileHandler", new PrivateKeyFactoryImpl<KeyFileHandler>());
setFactory("KeyConsoleHandler", new PrivateKeyFactoryImpl<KeyConsoleHandler>()); setFactory("KeyConsoleHandler", new PrivateKeyFactoryImpl<KeyConsoleHandler>());
} }
PrivateKeyFactoryMgr::~PrivateKeyFactoryMgr() PrivateKeyFactoryMgr::~PrivateKeyFactoryMgr()
{ {
} }
void PrivateKeyFactoryMgr::setFactory(const std::string& name, PrivateKeyFactory* pFactory) void PrivateKeyFactoryMgr::setFactory(const std::string& name, PrivateKeyFactory* pFactory)
{ {
bool success = _factories.insert(make_pair(name, Poco::SharedPtr<PrivateKeyFactory>(pFactory))).second; bool success = _factories.insert(make_pair(name, Poco::SharedPtr<PrivateKeyFactory>(pFactory))).second;
if (!success) if (!success)
delete pFactory; delete pFactory;
poco_assert(success); poco_assert(success);
} }
bool PrivateKeyFactoryMgr::hasFactory(const std::string& name) const bool PrivateKeyFactoryMgr::hasFactory(const std::string& name) const
{ {
return _factories.find(name) != _factories.end(); return _factories.find(name) != _factories.end();
} }
const PrivateKeyFactory* PrivateKeyFactoryMgr::getFactory(const std::string& name) const const PrivateKeyFactory* PrivateKeyFactoryMgr::getFactory(const std::string& name) const
{ {
FactoriesMap::const_iterator it = _factories.find(name); FactoriesMap::const_iterator it = _factories.find(name);
if (it != _factories.end()) if (it != _factories.end())
return it->second; return it->second;
else else
return 0; return 0;
} }
void PrivateKeyFactoryMgr::removeFactory(const std::string& name) void PrivateKeyFactoryMgr::removeFactory(const std::string& name)
{ {
_factories.erase(name); _factories.erase(name);
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,61 +1,61 @@
// //
// PrivateKeyPassphraseHandler.cpp // PrivateKeyPassphraseHandler.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/PrivateKeyPassphraseHandler.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/PrivateKeyPassphraseHandler.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: PrivateKeyPassphraseHandler // Module: PrivateKeyPassphraseHandler
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/PrivateKeyPassphraseHandler.h" #include "Poco/Net/PrivateKeyPassphraseHandler.h"
#include "Poco/Net/SSLManager.h" #include "Poco/Net/SSLManager.h"
#include "Poco/Delegate.h" #include "Poco/Delegate.h"
using Poco::Delegate; using Poco::Delegate;
namespace Poco { namespace Poco {
namespace Net { 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().PrivateKeyPassPhrase += Delegate<PrivateKeyPassphraseHandler, std::string>(this, &PrivateKeyPassphraseHandler::onPrivateKeyRequested);
} }
PrivateKeyPassphraseHandler::~PrivateKeyPassphraseHandler() PrivateKeyPassphraseHandler::~PrivateKeyPassphraseHandler()
{ {
SSLManager::instance().PrivateKeyPassPhrase -= Delegate<PrivateKeyPassphraseHandler, std::string>(this, &PrivateKeyPassphraseHandler::onPrivateKeyRequested); SSLManager::instance().PrivateKeyPassPhrase -= Delegate<PrivateKeyPassphraseHandler, std::string>(this, &PrivateKeyPassphraseHandler::onPrivateKeyRequested);
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,50 +1,50 @@
// //
// SSLException.cpp // SSLException.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/SSLException.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/SSLException.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: SSLException // Module: SSLException
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/SSLException.h" #include "Poco/Net/SSLException.h"
#include <typeinfo> #include <typeinfo>
namespace Poco { namespace Poco {
namespace Net { namespace Net {
POCO_IMPLEMENT_EXCEPTION(SSLException, NetException, "SSLException") POCO_IMPLEMENT_EXCEPTION(SSLException, NetException, "SSLException")
POCO_IMPLEMENT_EXCEPTION(SSLContextException, SSLException, "SSLContextException") POCO_IMPLEMENT_EXCEPTION(SSLContextException, SSLException, "SSLContextException")
POCO_IMPLEMENT_EXCEPTION(InvalidCertificateException, SSLException, "InvalidCertificateException") POCO_IMPLEMENT_EXCEPTION(InvalidCertificateException, SSLException, "InvalidCertificateException")
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,148 +1,148 @@
// //
// SSLInitializer.cpp // SSLInitializer.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/SSLInitializer.cpp#2 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/SSLInitializer.cpp#2 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: SSLInitializer // Module: SSLInitializer
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/SSLInitializer.h" #include "Poco/Net/SSLInitializer.h"
#include "Poco/Net/KeyConsoleHandler.h" #include "Poco/Net/KeyConsoleHandler.h"
#include "Poco/Net/KeyFileHandler.h" #include "Poco/Net/KeyFileHandler.h"
#include "Poco/RandomStream.h" #include "Poco/RandomStream.h"
#include "Poco/Thread.h" #include "Poco/Thread.h"
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/rand.h> #include <openssl/rand.h>
#include <openssl/crypto.h> #include <openssl/crypto.h>
using Poco::RandomInputStream; using Poco::RandomInputStream;
using Poco::Thread; using Poco::Thread;
using Poco::FastMutex; using Poco::FastMutex;
namespace Poco { namespace Poco {
namespace Net { namespace Net {
FastMutex* SSLInitializer::_mutexes(0); FastMutex* SSLInitializer::_mutexes(0);
int SSLInitializer::_rc(0); int SSLInitializer::_rc(0);
static SSLInitializer initializer; static SSLInitializer initializer;
SSLInitializer::SSLInitializer() SSLInitializer::SSLInitializer()
{ {
initialize(); initialize();
} }
SSLInitializer::~SSLInitializer() SSLInitializer::~SSLInitializer()
{ {
uninitialize(); uninitialize();
} }
void SSLInitializer::initialize() void SSLInitializer::initialize()
{ {
if (++_rc == 1) if (++_rc == 1)
{ {
poco_assert (1 == SSL_library_init()); // always returns 1 poco_assert (1 == SSL_library_init()); // always returns 1
SSL_load_error_strings(); SSL_load_error_strings();
char seed[SEEDSIZE]; char seed[SEEDSIZE];
RandomInputStream rnd; RandomInputStream rnd;
rnd.read(seed, sizeof(seed)); rnd.read(seed, sizeof(seed));
RAND_seed(seed, SEEDSIZE); RAND_seed(seed, SEEDSIZE);
int nMutexes = CRYPTO_num_locks(); int nMutexes = CRYPTO_num_locks();
_mutexes = new FastMutex[nMutexes]; _mutexes = new FastMutex[nMutexes];
CRYPTO_set_locking_callback(&SSLInitializer::lock); CRYPTO_set_locking_callback(&SSLInitializer::lock);
#ifndef POCO_OS_FAMILY_WINDOWS // SF# 1828231: random unhandled exceptions when linking with ssl #ifndef POCO_OS_FAMILY_WINDOWS // SF# 1828231: random unhandled exceptions when linking with ssl
CRYPTO_set_id_callback(&SSLInitializer::id); CRYPTO_set_id_callback(&SSLInitializer::id);
#endif #endif
CRYPTO_set_dynlock_create_callback(&SSLInitializer::dynlockCreate); CRYPTO_set_dynlock_create_callback(&SSLInitializer::dynlockCreate);
CRYPTO_set_dynlock_lock_callback(&SSLInitializer::dynlock); CRYPTO_set_dynlock_lock_callback(&SSLInitializer::dynlock);
CRYPTO_set_dynlock_destroy_callback(&SSLInitializer::dynlockDestroy); CRYPTO_set_dynlock_destroy_callback(&SSLInitializer::dynlockDestroy);
} }
} }
void SSLInitializer::uninitialize() void SSLInitializer::uninitialize()
{ {
if (--_rc == 0) if (--_rc == 0)
{ {
delete [] _mutexes; delete [] _mutexes;
} }
} }
void SSLInitializer::lock(int mode, int n, const char* file, int line) void SSLInitializer::lock(int mode, int n, const char* file, int line)
{ {
if (mode & CRYPTO_LOCK) if (mode & CRYPTO_LOCK)
_mutexes[n].lock(); _mutexes[n].lock();
else else
_mutexes[n].unlock(); _mutexes[n].unlock();
} }
unsigned long SSLInitializer::id() unsigned long SSLInitializer::id()
{ {
Thread* pThread = Thread::current(); Thread* pThread = Thread::current();
return pThread ? pThread->id() : 0; return pThread ? pThread->id() : 0;
} }
struct CRYPTO_dynlock_value* SSLInitializer::dynlockCreate(const char* file, int line) struct CRYPTO_dynlock_value* SSLInitializer::dynlockCreate(const char* file, int line)
{ {
return new CRYPTO_dynlock_value; return new CRYPTO_dynlock_value;
} }
void SSLInitializer::dynlock(int mode, struct CRYPTO_dynlock_value* lock, const char* file, int line) void SSLInitializer::dynlock(int mode, struct CRYPTO_dynlock_value* lock, const char* file, int line)
{ {
poco_check_ptr (lock); poco_check_ptr (lock);
if (mode & CRYPTO_LOCK) if (mode & CRYPTO_LOCK)
lock->_mutex.lock(); lock->_mutex.lock();
else else
lock->_mutex.unlock(); lock->_mutex.unlock();
} }
void SSLInitializer::dynlockDestroy(struct CRYPTO_dynlock_value* lock, const char* file, int line) void SSLInitializer::dynlockDestroy(struct CRYPTO_dynlock_value* lock, const char* file, int line)
{ {
delete lock; delete lock;
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,305 +1,305 @@
// //
// SSLManager.cpp // SSLManager.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/SSLManager.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/SSLManager.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: SSLManager // Module: SSLManager
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/SSLManager.h" #include "Poco/Net/SSLManager.h"
#include "Poco/Net/Context.h" #include "Poco/Net/Context.h"
#include "Poco/Net/Utility.h" #include "Poco/Net/Utility.h"
#include "Poco/Net/PrivateKeyPassphraseHandler.h" #include "Poco/Net/PrivateKeyPassphraseHandler.h"
#include "Poco/Net/SSLInitializer.h" #include "Poco/Net/SSLInitializer.h"
#include "Poco/SingletonHolder.h" #include "Poco/SingletonHolder.h"
#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" #include "Poco/Util/LayeredConfiguration.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
const std::string SSLManager::CFG_PRIV_KEY_FILE("privateKeyFile"); const std::string SSLManager::CFG_PRIV_KEY_FILE("privateKeyFile");
const std::string SSLManager::CFG_CA_LOCATION("caConfig"); const std::string SSLManager::CFG_CA_LOCATION("caConfig");
const std::string SSLManager::CFG_VER_MODE("verificationMode"); const std::string SSLManager::CFG_VER_MODE("verificationMode");
const Context::VerificationMode SSLManager::VAL_VER_MODE(Context::VERIFY_STRICT); const Context::VerificationMode SSLManager::VAL_VER_MODE(Context::VERIFY_STRICT);
const std::string SSLManager::CFG_VER_DEPTH("verificationDepth"); 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_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_CYPHER_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.");
SSLManager::SSLManager() SSLManager::SSLManager()
{ {
SSLInitializer::initialize(); SSLInitializer::initialize();
} }
SSLManager::~SSLManager() SSLManager::~SSLManager()
{ {
PrivateKeyPassPhrase.clear(); PrivateKeyPassPhrase.clear();
ClientVerificationError.clear(); ClientVerificationError.clear();
ServerVerificationError.clear(); ServerVerificationError.clear();
_ptrServerPassPhraseHandler = 0; _ptrServerPassPhraseHandler = 0;
_ptrServerCertificateHandler = 0; _ptrServerCertificateHandler = 0;
_ptrDefaultServerContext = 0; _ptrDefaultServerContext = 0;
_ptrClientPassPhraseHandler = 0; _ptrClientPassPhraseHandler = 0;
_ptrClientCertificateHandler = 0; _ptrClientCertificateHandler = 0;
_ptrDefaultClientContext = 0; _ptrDefaultClientContext = 0;
SSLInitializer::uninitialize(); SSLInitializer::uninitialize();
} }
SSLManager& SSLManager::instance() SSLManager& SSLManager::instance()
{ {
static Poco::SingletonHolder<SSLManager> singleton; static Poco::SingletonHolder<SSLManager> singleton;
return *singleton.get(); return *singleton.get();
} }
void SSLManager::initializeServer(PrivateKeyPassphraseHandlerPtr& ptrPassPhraseHandler, InvalidCertificateHandlerPtr& ptrHandler, ContextPtr ptrContext) void SSLManager::initializeServer(PrivateKeyPassphraseHandlerPtr& ptrPassPhraseHandler, InvalidCertificateHandlerPtr& ptrHandler, ContextPtr ptrContext)
{ {
_ptrServerPassPhraseHandler = ptrPassPhraseHandler; _ptrServerPassPhraseHandler = ptrPassPhraseHandler;
_ptrServerCertificateHandler = ptrHandler; _ptrServerCertificateHandler = ptrHandler;
_ptrDefaultServerContext = ptrContext; _ptrDefaultServerContext = ptrContext;
} }
void SSLManager::initializeClient(PrivateKeyPassphraseHandlerPtr& ptrPassPhraseHandler, InvalidCertificateHandlerPtr& ptrHandler, ContextPtr ptrContext) void SSLManager::initializeClient(PrivateKeyPassphraseHandlerPtr& ptrPassPhraseHandler, InvalidCertificateHandlerPtr& ptrHandler, ContextPtr ptrContext)
{ {
_ptrClientPassPhraseHandler = ptrPassPhraseHandler; _ptrClientPassPhraseHandler = ptrPassPhraseHandler;
_ptrClientCertificateHandler = ptrHandler; _ptrClientCertificateHandler = ptrHandler;
_ptrDefaultClientContext = ptrContext; _ptrDefaultClientContext = ptrContext;
} }
SSLManager::ContextPtr SSLManager::defaultServerContext() SSLManager::ContextPtr SSLManager::defaultServerContext()
{ {
if (!_ptrDefaultServerContext) if (!_ptrDefaultServerContext)
initDefaultContext(true); initDefaultContext(true);
return _ptrDefaultServerContext; return _ptrDefaultServerContext;
} }
SSLManager::ContextPtr SSLManager::defaultClientContext() SSLManager::ContextPtr SSLManager::defaultClientContext()
{ {
if (!_ptrDefaultClientContext) if (!_ptrDefaultClientContext)
initDefaultContext(false); initDefaultContext(false);
return _ptrDefaultClientContext; return _ptrDefaultClientContext;
} }
SSLManager::PrivateKeyPassphraseHandlerPtr SSLManager::serverPassPhraseHandler() SSLManager::PrivateKeyPassphraseHandlerPtr SSLManager::serverPassPhraseHandler()
{ {
if (!_ptrServerPassPhraseHandler) if (!_ptrServerPassPhraseHandler)
initPassPhraseHandler(true); initPassPhraseHandler(true);
return _ptrServerPassPhraseHandler; return _ptrServerPassPhraseHandler;
} }
SSLManager::PrivateKeyPassphraseHandlerPtr SSLManager::clientPassPhraseHandler() SSLManager::PrivateKeyPassphraseHandlerPtr SSLManager::clientPassPhraseHandler()
{ {
if (!_ptrClientPassPhraseHandler) if (!_ptrClientPassPhraseHandler)
initPassPhraseHandler(false); initPassPhraseHandler(false);
return _ptrClientPassPhraseHandler; return _ptrClientPassPhraseHandler;
} }
SSLManager::InvalidCertificateHandlerPtr SSLManager::serverCertificateHandler() SSLManager::InvalidCertificateHandlerPtr SSLManager::serverCertificateHandler()
{ {
if (!_ptrServerCertificateHandler) if (!_ptrServerCertificateHandler)
initCertificateHandler(true); initCertificateHandler(true);
return _ptrServerCertificateHandler; return _ptrServerCertificateHandler;
} }
SSLManager::InvalidCertificateHandlerPtr SSLManager::clientCertificateHandler() SSLManager::InvalidCertificateHandlerPtr SSLManager::clientCertificateHandler()
{ {
if (!_ptrClientCertificateHandler) if (!_ptrClientCertificateHandler)
initCertificateHandler(false); initCertificateHandler(false);
return _ptrClientCertificateHandler; return _ptrClientCertificateHandler;
} }
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);
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);
else else
SSLManager::instance().ClientVerificationError.notify(&SSLManager::instance(), args); SSLManager::instance().ClientVerificationError.notify(&SSLManager::instance(), args);
ok = args.getIgnoreError() ? 1 : 0; ok = args.getIgnoreError() ? 1 : 0;
} }
return ok; return ok;
} }
int SSLManager::privateKeyPasswdCallback(char* pBuf, int size, int flag, void* userData) int SSLManager::privateKeyPasswdCallback(char* pBuf, int size, int flag, void* userData)
{ {
std::string pwd; std::string pwd;
SSLManager::instance().PrivateKeyPassPhrase.notify(&SSLManager::instance(), pwd); SSLManager::instance().PrivateKeyPassPhrase.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();
return size; return size;
} }
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); initEvents(server);
Poco::Util::LayeredConfiguration& config = Poco::Util::Application::instance().config(); Poco::Util::LayeredConfiguration& config = Poco::Util::Application::instance().config();
std::string prefix = server ? CFG_SERVER_PREFIX : CFG_CLIENT_PREFIX; std::string prefix = server ? CFG_SERVER_PREFIX : CFG_CLIENT_PREFIX;
if (!config.hasProperty(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); throw Poco::Util::EmptyOptionException(std::string("Missing Configuration Entry: ") + prefix+CFG_PRIV_KEY_FILE);
} }
// mandatory options // mandatory options
std::string privKeyFile = config.getString(prefix+CFG_PRIV_KEY_FILE); std::string privKeyFile = config.getString(prefix+CFG_PRIV_KEY_FILE);
std::string caLocation = config.getString(prefix+CFG_CA_LOCATION); std::string caLocation = config.getString(prefix+CFG_CA_LOCATION);
// 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
std::string mode = config.getString(prefix+CFG_VER_MODE); std::string mode = config.getString(prefix+CFG_VER_MODE);
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 cypherList = config.getString(prefix+CFG_CYPHER_LIST, VAL_CYPHER_LIST);
if (server) if (server)
{ {
_ptrDefaultServerContext = new Context(privKeyFile, caLocation, server, verMode, verDepth, loadDefCA, cypherList); _ptrDefaultServerContext = new Context(privKeyFile, caLocation, server, verMode, verDepth, loadDefCA, cypherList);
} }
else else
{ {
_ptrDefaultClientContext = new Context(privKeyFile, caLocation, server, verMode, verDepth, loadDefCA, cypherList); _ptrDefaultClientContext = new Context(privKeyFile, caLocation, server, verMode, verDepth, loadDefCA, cypherList);
} }
} }
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::LayeredConfiguration& config = Poco::Util::Application::instance().config();
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))
{ {
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 PassPhrasehandler 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::LayeredConfiguration& config = Poco::Util::Application::instance().config();
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))
{ {
pFactory = certificateHandlerFactoryMgr().getFactory(className); pFactory = certificateHandlerFactoryMgr().getFactory(className);
} }
if (pFactory) if (pFactory)
{ {
if (server) if (server)
_ptrServerCertificateHandler = pFactory->create(true); _ptrServerCertificateHandler = pFactory->create(true);
else else
_ptrClientCertificateHandler = pFactory->create(false); _ptrClientCertificateHandler = pFactory->create(false);
} }
else throw Poco::Util::UnknownOptionException(std::string("No InvalidCertificate handler known with the name ") + className); else throw Poco::Util::UnknownOptionException(std::string("No InvalidCertificate handler known with the name ") + className);
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,113 +1,113 @@
// //
// SecureServerSocket.cpp // SecureServerSocket.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/SecureServerSocket.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/SecureServerSocket.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLSockets // Package: SSLSockets
// Module: SecureServerSocket // Module: SecureServerSocket
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/SecureServerSocket.h" #include "Poco/Net/SecureServerSocket.h"
#include "Poco/Net/SecureServerSocketImpl.h" #include "Poco/Net/SecureServerSocketImpl.h"
#include "Poco/Net/SecureStreamSocket.h" #include "Poco/Net/SecureStreamSocket.h"
#include "Poco/Exception.h" #include "Poco/Exception.h"
using Poco::InvalidArgumentException; using Poco::InvalidArgumentException;
namespace Poco { namespace Poco {
namespace Net { namespace Net {
SecureServerSocket::SecureServerSocket(): SecureServerSocket::SecureServerSocket():
ServerSocket(new SecureServerSocketImpl, true) ServerSocket(new SecureServerSocketImpl, true)
{ {
} }
SecureServerSocket::SecureServerSocket(const Socket& socket): SecureServerSocket::SecureServerSocket(const Socket& socket):
ServerSocket(socket) ServerSocket(socket)
{ {
if (!dynamic_cast<SecureServerSocketImpl*>(impl())) if (!dynamic_cast<SecureServerSocketImpl*>(impl()))
throw InvalidArgumentException("Cannot assign incompatible socket"); throw InvalidArgumentException("Cannot assign incompatible socket");
} }
SecureServerSocket::SecureServerSocket(const SocketAddress& address, int backlog): SecureServerSocket::SecureServerSocket(const SocketAddress& address, int backlog):
ServerSocket(new SecureServerSocketImpl, true) ServerSocket(new SecureServerSocketImpl, true)
{ {
impl()->bind(address, true); impl()->bind(address, true);
impl()->listen(backlog); impl()->listen(backlog);
} }
SecureServerSocket::SecureServerSocket(Poco::UInt16 port, int backlog): SecureServerSocket::SecureServerSocket(Poco::UInt16 port, int backlog):
ServerSocket(new SecureServerSocketImpl, true) ServerSocket(new SecureServerSocketImpl, true)
{ {
IPAddress wildcardAddr; IPAddress wildcardAddr;
SocketAddress address(wildcardAddr, port); SocketAddress address(wildcardAddr, port);
impl()->bind(address, true); impl()->bind(address, true);
impl()->listen(backlog); impl()->listen(backlog);
} }
SecureServerSocket::~SecureServerSocket() SecureServerSocket::~SecureServerSocket()
{ {
} }
SecureServerSocket& SecureServerSocket::operator = (const Socket& socket) SecureServerSocket& SecureServerSocket::operator = (const Socket& socket)
{ {
if (&socket != this) if (&socket != this)
{ {
if (dynamic_cast<SecureServerSocketImpl*>(socket.impl())) if (dynamic_cast<SecureServerSocketImpl*>(socket.impl()))
ServerSocket::operator = (socket); ServerSocket::operator = (socket);
else else
throw InvalidArgumentException("Cannot assign incompatible socket"); throw InvalidArgumentException("Cannot assign incompatible socket");
} }
return *this; return *this;
} }
StreamSocket SecureServerSocket::acceptConnection(SocketAddress& clientAddr) StreamSocket SecureServerSocket::acceptConnection(SocketAddress& clientAddr)
{ {
return SecureStreamSocket(impl()->acceptConnection(clientAddr)); return SecureStreamSocket(impl()->acceptConnection(clientAddr));
} }
StreamSocket SecureServerSocket::acceptConnection() StreamSocket SecureServerSocket::acceptConnection()
{ {
SocketAddress clientAddr; SocketAddress clientAddr;
return SecureStreamSocket(impl()->acceptConnection(clientAddr)); return SecureStreamSocket(impl()->acceptConnection(clientAddr));
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,131 +1,131 @@
// //
// SecureServerSocketImpl.cpp // SecureServerSocketImpl.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/SecureServerSocketImpl.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/SecureServerSocketImpl.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLSockets // Package: SSLSockets
// Module: SecureServerSocketImpl // Module: SecureServerSocketImpl
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/SecureServerSocketImpl.h" #include "Poco/Net/SecureServerSocketImpl.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
SecureServerSocketImpl::SecureServerSocketImpl() SecureServerSocketImpl::SecureServerSocketImpl()
{ {
} }
SecureServerSocketImpl::~SecureServerSocketImpl() SecureServerSocketImpl::~SecureServerSocketImpl()
{ {
} }
SocketImpl* SecureServerSocketImpl::acceptConnection(SocketAddress& clientAddr) SocketImpl* SecureServerSocketImpl::acceptConnection(SocketAddress& clientAddr)
{ {
return _socket.acceptConnection(clientAddr); return _socket.acceptConnection(clientAddr);
} }
void SecureServerSocketImpl::connect(const SocketAddress& address) void SecureServerSocketImpl::connect(const SocketAddress& address)
{ {
_socket.connect(address); _socket.connect(address);
setSockfd(_socket.sockfd()); setSockfd(_socket.sockfd());
} }
void SecureServerSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout) void SecureServerSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout)
{ {
_socket.connect(address, timeout); _socket.connect(address, timeout);
setSockfd(_socket.sockfd()); setSockfd(_socket.sockfd());
} }
void SecureServerSocketImpl::connectNB(const SocketAddress& address) void SecureServerSocketImpl::connectNB(const SocketAddress& address)
{ {
_socket.connectNB(address); _socket.connectNB(address);
setSockfd(_socket.sockfd()); setSockfd(_socket.sockfd());
} }
void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddress) void SecureServerSocketImpl::bind(const SocketAddress& address, bool reuseAddress)
{ {
_socket.bind(address, reuseAddress); _socket.bind(address, reuseAddress);
} }
void SecureServerSocketImpl::listen(int backlog) void SecureServerSocketImpl::listen(int backlog)
{ {
_socket.listen(backlog); _socket.listen(backlog);
setSockfd(_socket.sockfd()); setSockfd(_socket.sockfd());
} }
void SecureServerSocketImpl::close() void SecureServerSocketImpl::close()
{ {
invalidate(); invalidate();
_socket.close(); _socket.close();
} }
int SecureServerSocketImpl::sendBytes(const void* buffer, int length, int flags) int SecureServerSocketImpl::sendBytes(const void* buffer, int length, int flags)
{ {
return _socket.sendBytes(buffer, length, flags); return _socket.sendBytes(buffer, length, flags);
} }
int SecureServerSocketImpl::receiveBytes(void* buffer, int length, int flags) int SecureServerSocketImpl::receiveBytes(void* buffer, int length, int flags)
{ {
return _socket.receiveBytes(buffer, length, flags); return _socket.receiveBytes(buffer, length, flags);
} }
int SecureServerSocketImpl::sendTo(const void* buffer, int length, const SocketAddress& address, int flags) int SecureServerSocketImpl::sendTo(const void* buffer, int length, const SocketAddress& address, int flags)
{ {
return _socket.sendTo(buffer, length, address, flags); return _socket.sendTo(buffer, length, address, flags);
} }
int SecureServerSocketImpl::receiveFrom(void* buffer, int length, SocketAddress& address, int flags) int SecureServerSocketImpl::receiveFrom(void* buffer, int length, SocketAddress& address, int flags)
{ {
return _socket.receiveFrom(buffer, length, address, flags); return _socket.receiveFrom(buffer, length, address, flags);
} }
void SecureServerSocketImpl::sendUrgent(unsigned char data) void SecureServerSocketImpl::sendUrgent(unsigned char data)
{ {
return _socket.sendUrgent(data); return _socket.sendUrgent(data);
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,94 +1,94 @@
// //
// SecureStreamSocket.cpp // SecureStreamSocket.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/SecureStreamSocket.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/SecureStreamSocket.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLSockets // Package: SSLSockets
// Module: SecureStreamSocket // Module: SecureStreamSocket
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/SecureStreamSocket.h" #include "Poco/Net/SecureStreamSocket.h"
#include "Poco/Net/SecureStreamSocketImpl.h" #include "Poco/Net/SecureStreamSocketImpl.h"
#include "Poco/Net/SocketImpl.h" #include "Poco/Net/SocketImpl.h"
#include "Poco/Exception.h" #include "Poco/Exception.h"
using Poco::InvalidArgumentException; using Poco::InvalidArgumentException;
namespace Poco { namespace Poco {
namespace Net { namespace Net {
SecureStreamSocket::SecureStreamSocket(): SecureStreamSocket::SecureStreamSocket():
StreamSocket(new SecureStreamSocketImpl) StreamSocket(new SecureStreamSocketImpl)
{ {
} }
SecureStreamSocket::SecureStreamSocket(const SocketAddress& address): SecureStreamSocket::SecureStreamSocket(const SocketAddress& address):
StreamSocket(new SecureStreamSocketImpl) StreamSocket(new SecureStreamSocketImpl)
{ {
connect(address); 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");
} }
SecureStreamSocket::SecureStreamSocket(SocketImpl* pImpl): SecureStreamSocket::SecureStreamSocket(SocketImpl* pImpl):
StreamSocket(pImpl) StreamSocket(pImpl)
{ {
if (!dynamic_cast<SecureStreamSocketImpl*>(impl())) if (!dynamic_cast<SecureStreamSocketImpl*>(impl()))
throw InvalidArgumentException("Cannot assign incompatible socket"); throw InvalidArgumentException("Cannot assign incompatible socket");
} }
SecureStreamSocket::~SecureStreamSocket() SecureStreamSocket::~SecureStreamSocket()
{ {
} }
SecureStreamSocket& SecureStreamSocket::operator = (const Socket& socket) SecureStreamSocket& SecureStreamSocket::operator = (const Socket& socket)
{ {
if (dynamic_cast<SecureStreamSocketImpl*>(socket.impl())) if (dynamic_cast<SecureStreamSocketImpl*>(socket.impl()))
StreamSocket::operator = (socket); StreamSocket::operator = (socket);
else else
throw InvalidArgumentException("Cannot assign incompatible socket"); throw InvalidArgumentException("Cannot assign incompatible socket");
return *this; return *this;
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,145 +1,145 @@
// //
// SecureStreamSocketImpl.cpp // SecureStreamSocketImpl.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/SecureStreamSocketImpl.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/SecureStreamSocketImpl.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLSockets // Package: SSLSockets
// Module: SecureStreamSocketImpl // Module: SecureStreamSocketImpl
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/SecureStreamSocketImpl.h" #include "Poco/Net/SecureStreamSocketImpl.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
SecureStreamSocketImpl::SecureStreamSocketImpl() SecureStreamSocketImpl::SecureStreamSocketImpl()
{ {
} }
SecureStreamSocketImpl::SecureStreamSocketImpl(SSL* _pSSL): _socket(_pSSL) SecureStreamSocketImpl::SecureStreamSocketImpl(SSL* _pSSL): _socket(_pSSL)
{ {
setSockfd(_socket.sockfd()); setSockfd(_socket.sockfd());
} }
SecureStreamSocketImpl::~SecureStreamSocketImpl() SecureStreamSocketImpl::~SecureStreamSocketImpl()
{ {
} }
SocketImpl* SecureStreamSocketImpl::acceptConnection(SocketAddress& clientAddr) SocketImpl* SecureStreamSocketImpl::acceptConnection(SocketAddress& clientAddr)
{ {
return _socket.acceptConnection(clientAddr); return _socket.acceptConnection(clientAddr);
} }
void SecureStreamSocketImpl::connect(const SocketAddress& address) void SecureStreamSocketImpl::connect(const SocketAddress& address)
{ {
_socket.connect(address); _socket.connect(address);
setSockfd(_socket.sockfd()); setSockfd(_socket.sockfd());
} }
void SecureStreamSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout) void SecureStreamSocketImpl::connect(const SocketAddress& address, const Poco::Timespan& timeout)
{ {
_socket.connect(address, timeout); _socket.connect(address, timeout);
setSockfd(_socket.sockfd()); setSockfd(_socket.sockfd());
} }
void SecureStreamSocketImpl::connectNB(const SocketAddress& address) void SecureStreamSocketImpl::connectNB(const SocketAddress& address)
{ {
_socket.connectNB(address); _socket.connectNB(address);
setSockfd(_socket.sockfd()); setSockfd(_socket.sockfd());
} }
void SecureStreamSocketImpl::bind(const SocketAddress& address, bool reuseAddress) void SecureStreamSocketImpl::bind(const SocketAddress& address, bool reuseAddress)
{ {
_socket.bind(address, reuseAddress); _socket.bind(address, reuseAddress);
} }
void SecureStreamSocketImpl::listen(int backlog) void SecureStreamSocketImpl::listen(int backlog)
{ {
_socket.listen(backlog); _socket.listen(backlog);
setSockfd(_socket.sockfd()); setSockfd(_socket.sockfd());
} }
void SecureStreamSocketImpl::close() void SecureStreamSocketImpl::close()
{ {
invalidate(); invalidate();
_socket.close(); _socket.close();
} }
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) while (remaining > 0)
{ {
int n = _socket.sendBytes(p, length, flags); int n = _socket.sendBytes(p, length, flags);
p += n; p += n;
remaining -= n; remaining -= n;
} }
return length; return length;
} }
int SecureStreamSocketImpl::receiveBytes(void* buffer, int length, int flags) int SecureStreamSocketImpl::receiveBytes(void* buffer, int length, int flags)
{ {
return _socket.receiveBytes(buffer, length, flags); return _socket.receiveBytes(buffer, length, flags);
} }
int SecureStreamSocketImpl::sendTo(const void* buffer, int length, const SocketAddress& address, int flags) int SecureStreamSocketImpl::sendTo(const void* buffer, int length, const SocketAddress& address, int flags)
{ {
return _socket.sendTo(buffer, length, address, flags); return _socket.sendTo(buffer, length, address, flags);
} }
int SecureStreamSocketImpl::receiveFrom(void* buffer, int length, SocketAddress& address, int flags) int SecureStreamSocketImpl::receiveFrom(void* buffer, int length, SocketAddress& address, int flags)
{ {
return _socket.receiveFrom(buffer, length, address, flags); return _socket.receiveFrom(buffer, length, address, flags);
} }
void SecureStreamSocketImpl::sendUrgent(unsigned char data) void SecureStreamSocketImpl::sendUrgent(unsigned char data)
{ {
return _socket.sendUrgent(data); return _socket.sendUrgent(data);
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,135 +1,135 @@
// //
// Utility.cpp // Utility.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/Utility.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/Utility.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: Utility // Module: Utility
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/Utility.h" #include "Poco/Net/Utility.h"
#include "Poco/String.h" #include "Poco/String.h"
#include "Poco/Util/OptionException.h" #include "Poco/Util/OptionException.h"
#include <openssl/err.h> #include <openssl/err.h>
namespace Poco { namespace Poco {
namespace Net { namespace Net {
int Utility::HTTPS_PORT = 443; int Utility::HTTPS_PORT = 443;
Context::VerificationMode Utility::convertVerificationMode(const std::string& vMode) Context::VerificationMode Utility::convertVerificationMode(const std::string& vMode)
{ {
std::string mode = Poco::toLower(vMode); std::string mode = Poco::toLower(vMode);
Context::VerificationMode verMode = Context::VERIFY_STRICT; Context::VerificationMode verMode = Context::VERIFY_STRICT;
if (mode == "none") if (mode == "none")
verMode = Context::VERIFY_NONE; verMode = Context::VERIFY_NONE;
else if (mode == "relaxed") else if (mode == "relaxed")
verMode = Context::VERIFY_RELAXED; verMode = Context::VERIFY_RELAXED;
else if (mode == "strict") else if (mode == "strict")
verMode = Context::VERIFY_STRICT; verMode = Context::VERIFY_STRICT;
else if (mode == "once") else if (mode == "once")
verMode = Context::VERIFY_ONCE; verMode = Context::VERIFY_ONCE;
else else
throw Poco::Util::OptionException(std::string("Wrong value >") + vMode + std::string("< for a verificationMode. Can only be none, relaxed, strict or once.")); throw Poco::Util::OptionException(std::string("Wrong value >") + vMode + std::string("< for a verificationMode. Can only be none, relaxed, strict or once."));
return verMode; return verMode;
} }
std::string Utility::convertCertificateError(long errCode) std::string Utility::convertCertificateError(long errCode)
{ {
std::string errMsg(X509_verify_cert_error_string(errCode)); std::string errMsg(X509_verify_cert_error_string(errCode));
return errMsg; return errMsg;
} }
std::string Utility::convertSSLError(SSL* pSSL, int errCode) std::string Utility::convertSSLError(SSL* pSSL, int errCode)
{ {
std::string errMsg; std::string errMsg;
if (errCode > 0) return "no error"; if (errCode > 0) return "no error";
int connectErr = SSL_get_error(pSSL, errCode); int connectErr = SSL_get_error(pSSL, errCode);
long lErr = 0; long lErr = 0;
char buf[512]; char buf[512];
switch (connectErr) switch (connectErr)
{ {
case SSL_ERROR_ZERO_RETURN: case SSL_ERROR_ZERO_RETURN:
// connection closed // connection closed
errMsg = "connection closed by server"; errMsg = "connection closed by server";
break; break;
case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_READ:
errMsg = "want read"; errMsg = "want read";
break; break;
case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_WRITE:
errMsg = "want write"; errMsg = "want write";
break; break;
case SSL_ERROR_WANT_CONNECT: case SSL_ERROR_WANT_CONNECT:
errMsg = "want connect"; errMsg = "want connect";
break; break;
case SSL_ERROR_WANT_ACCEPT: case SSL_ERROR_WANT_ACCEPT:
errMsg = "want accept"; errMsg = "want accept";
break; break;
case SSL_ERROR_WANT_X509_LOOKUP: case SSL_ERROR_WANT_X509_LOOKUP:
errMsg = "want lookup"; errMsg = "want lookup";
break; break;
case SSL_ERROR_SYSCALL: case SSL_ERROR_SYSCALL:
errMsg = "syscall"; errMsg = "syscall";
break; break;
case SSL_ERROR_SSL: case SSL_ERROR_SSL:
lErr = ERR_get_error(); lErr = ERR_get_error();
if (errCode == 0) if (errCode == 0)
{ {
errMsg = "EOF was observed"; errMsg = "EOF was observed";
} }
else if (errCode == -1) else if (errCode == -1)
{ {
errMsg = "The underlying BIO reported an I/O error"; errMsg = "The underlying BIO reported an I/O error";
} }
else else
{ {
ERR_error_string_n(lErr, buf, 512); ERR_error_string_n(lErr, buf, 512);
errMsg = buf; errMsg = buf;
} }
break; break;
default: default:
errMsg = "none"; errMsg = "none";
} }
return errMsg; return errMsg;
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,59 +1,59 @@
// //
// VerificationErrorArgs.cpp // VerificationErrorArgs.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/src/VerificationErrorArgs.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/src/VerificationErrorArgs.cpp#1 $
// //
// Library: NetSSL_OpenSSL // Library: NetSSL_OpenSSL
// Package: SSLCore // Package: SSLCore
// Module: VerificationErrorArgs // Module: VerificationErrorArgs
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "Poco/Net/VerificationErrorArgs.h" #include "Poco/Net/VerificationErrorArgs.h"
namespace Poco { namespace Poco {
namespace Net { namespace Net {
VerificationErrorArgs::VerificationErrorArgs(const X509Certificate& cert, int errDepth, int errNum, const std::string& errMsg): VerificationErrorArgs::VerificationErrorArgs(const X509Certificate& cert, int errDepth, int errNum, const std::string& errMsg):
_cert(cert), _cert(cert),
_errorDepth(errDepth), _errorDepth(errDepth),
_errorNumber(errNum), _errorNumber(errNum),
_errorMessage(errMsg), _errorMessage(errMsg),
_ignoreError(false) _ignoreError(false)
{ {
} }
VerificationErrorArgs::~VerificationErrorArgs() VerificationErrorArgs::~VerificationErrorArgs()
{ {
} }
} } // namespace Poco::Net } } // namespace Poco::Net

View File

@@ -1,9 +1,9 @@
# #
# TestSuite.vmsbuild # TestSuite.vmsbuild
# #
# $Id: //poco/Main/template/TestSuite.vmsbuild#3 $ # $Id: //poco/Main/template/TestSuite.vmsbuild#3 $
# #
EXE=TestRunner EXE=TestRunner
OpenSSLTestSuite OpenSSLTestSuite
Driver Driver
<SourceFilesHere> <SourceFilesHere>

View File

@@ -1,42 +1,42 @@
<AppConfig> <AppConfig>
<openSSL> <openSSL>
<server> <server>
<privateKeyFile>${application.configDir}any.pem</privateKeyFile> <privateKeyFile>${application.configDir}any.pem</privateKeyFile>
<caConfig>${application.configDir}rootcert.pem</caConfig> <caConfig>${application.configDir}rootcert.pem</caConfig>
<verificationMode>none</verificationMode> <verificationMode>none</verificationMode>
<verificationDepth>9</verificationDepth> <verificationDepth>9</verificationDepth>
<loadDefaultCAFile>true</loadDefaultCAFile> <loadDefaultCAFile>true</loadDefaultCAFile>
<cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList> <cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList>
<privateKeyPassphraseHandler> <privateKeyPassphraseHandler>
<name>KeyFileHandler</name> <name>KeyFileHandler</name>
<options> <options>
<password>test</password> <password>test</password>
</options> </options>
</privateKeyPassphraseHandler> </privateKeyPassphraseHandler>
<invalidCertificateHandler> <invalidCertificateHandler>
<name>AcceptCertificateHandler</name> <name>AcceptCertificateHandler</name>
<options> <options>
</options> </options>
</invalidCertificateHandler> </invalidCertificateHandler>
</server> </server>
<client> <client>
<privateKeyFile>${application.configDir}any.pem</privateKeyFile> <privateKeyFile>${application.configDir}any.pem</privateKeyFile>
<caConfig>${application.configDir}rootcert.pem</caConfig> <caConfig>${application.configDir}rootcert.pem</caConfig>
<verificationMode>relaxed</verificationMode> <verificationMode>relaxed</verificationMode>
<verificationDepth>9</verificationDepth> <verificationDepth>9</verificationDepth>
<loadDefaultCAFile>true</loadDefaultCAFile> <loadDefaultCAFile>true</loadDefaultCAFile>
<cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList> <cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList>
<privateKeyPassphraseHandler> <privateKeyPassphraseHandler>
<name>KeyFileHandler</name> <name>KeyFileHandler</name>
<options> <options>
<password>test</password> <password>test</password>
</options> </options>
</privateKeyPassphraseHandler> </privateKeyPassphraseHandler>
<invalidCertificateHandler> <invalidCertificateHandler>
<name>AcceptCertificateHandler</name> <name>AcceptCertificateHandler</name>
<options> <options>
</options> </options>
</invalidCertificateHandler> </invalidCertificateHandler>
</client> </client>
</openSSL> </openSSL>
</AppConfig> </AppConfig>

View File

@@ -1,381 +1,381 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.10" Version="7.10"
Name="TestSuite" Name="TestSuite"
ProjectGUID="{5B023A89-A469-11DA-8DA6-005056C00008}" ProjectGUID="{5B023A89-A469-11DA-8DA6-005056C00008}"
Keyword="Win32Proj"> Keyword="Win32Proj">
<Platforms> <Platforms>
<Platform <Platform
Name="Win32"/> Name="Win32"/>
</Platforms> </Platforms>
<Configurations> <Configurations>
<Configuration <Configuration
Name="debug_shared|Win32" Name="debug_shared|Win32"
OutputDirectory="obj\debug_shared" OutputDirectory="obj\debug_shared"
IntermediateDirectory="obj\debug_shared" IntermediateDirectory="obj\debug_shared"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2"> CharacterSet="2">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\include;..\..\Net\include;..\..\Foundation\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Util\include" AdditionalIncludeDirectories="..\include;..\..\Net\include;..\..\Foundation\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Util\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
MinimalRebuild="TRUE" MinimalRebuild="TRUE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
BufferSecurityCheck="TRUE" BufferSecurityCheck="TRUE"
TreatWChar_tAsBuiltInType="TRUE" TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="TRUE" ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE" RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/> DebugInformationFormat="4"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="CppUnitd.lib WinTestRunnerd.lib PocoFoundationd.lib PocoNetd.lib PocoNetSSLd.lib PocoUtild.lib" AdditionalDependencies="CppUnitd.lib WinTestRunnerd.lib PocoFoundationd.lib PocoNetd.lib PocoNetSSLd.lib PocoUtild.lib"
OutputFile="bin/TestSuited.exe" OutputFile="bin/TestSuited.exe"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="..\..\lib" AdditionalLibraryDirectories="..\..\lib"
GenerateDebugInformation="TRUE" GenerateDebugInformation="TRUE"
ProgramDatabaseFile="bin/TestSuited.pdb" ProgramDatabaseFile="bin/TestSuited.pdb"
SubSystem="2" SubSystem="2"
TargetMachine="1"/> TargetMachine="1"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCPostBuildEventTool"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool"/> Name="VCResourceCompilerTool"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool <Tool
Name="VCManagedWrapperGeneratorTool"/> Name="VCManagedWrapperGeneratorTool"/>
<Tool <Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
<Configuration <Configuration
Name="release_shared|Win32" Name="release_shared|Win32"
OutputDirectory="obj\release_shared" OutputDirectory="obj\release_shared"
IntermediateDirectory="obj\release_shared" IntermediateDirectory="obj\release_shared"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2"> CharacterSet="2">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="4" Optimization="4"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
EnableIntrinsicFunctions="TRUE" EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="TRUE" OmitFramePointers="TRUE"
OptimizeForWindowsApplication="TRUE" OptimizeForWindowsApplication="TRUE"
AdditionalIncludeDirectories="..\include;..\..\Net\include;..\..\Foundation\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Util\include" AdditionalIncludeDirectories="..\include;..\..\Net\include;..\..\Foundation\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Util\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="FALSE" BufferSecurityCheck="FALSE"
TreatWChar_tAsBuiltInType="TRUE" TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="TRUE" ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE" RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/> DebugInformationFormat="3"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="CppUnit.lib WinTestRunner.lib PocoFoundation.lib PocoNet.lib PocoNetSSL.lib PocoUtil.lib" AdditionalDependencies="CppUnit.lib WinTestRunner.lib PocoFoundation.lib PocoNet.lib PocoNetSSL.lib PocoUtil.lib"
OutputFile="bin/TestSuite.exe" OutputFile="bin/TestSuite.exe"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="..\..\lib" AdditionalLibraryDirectories="..\..\lib"
GenerateDebugInformation="FALSE" GenerateDebugInformation="FALSE"
ProgramDatabaseFile="" ProgramDatabaseFile=""
SubSystem="2" SubSystem="2"
OptimizeReferences="2" OptimizeReferences="2"
EnableCOMDATFolding="2" EnableCOMDATFolding="2"
TargetMachine="1"/> TargetMachine="1"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCPostBuildEventTool"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool"/> Name="VCResourceCompilerTool"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool <Tool
Name="VCManagedWrapperGeneratorTool"/> Name="VCManagedWrapperGeneratorTool"/>
<Tool <Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
<Configuration <Configuration
Name="debug_static|Win32" Name="debug_static|Win32"
OutputDirectory="$(ConfigurationName)" OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2"> CharacterSet="2">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\include;..\..\Net\include;..\..\Foundation\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Util\include" AdditionalIncludeDirectories="..\include;..\..\Net\include;..\..\Foundation\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Util\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
MinimalRebuild="TRUE" MinimalRebuild="TRUE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
BufferSecurityCheck="TRUE" BufferSecurityCheck="TRUE"
TreatWChar_tAsBuiltInType="TRUE" TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="TRUE" ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE" RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/> DebugInformationFormat="4"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="CppUnitmtd.lib WinTestRunnermtd.lib PocoFoundationmtd.lib PocoNetmtd.lib PocoNetSSLmtd.lib PocoUtilmtd.lib libeay32mtd.lib ssleay32mtd.lib PocoXMLmtd.lib winmm.lib" AdditionalDependencies="CppUnitmtd.lib WinTestRunnermtd.lib PocoFoundationmtd.lib PocoNetmtd.lib PocoNetSSLmtd.lib PocoUtilmtd.lib libeay32mtd.lib ssleay32mtd.lib PocoXMLmtd.lib winmm.lib"
OutputFile="bin/TestSuitemtd.exe" OutputFile="bin/TestSuitemtd.exe"
LinkIncremental="2" LinkIncremental="2"
AdditionalLibraryDirectories="..\..\lib" AdditionalLibraryDirectories="..\..\lib"
GenerateDebugInformation="TRUE" GenerateDebugInformation="TRUE"
ProgramDatabaseFile="bin/TestSuited.pdb" ProgramDatabaseFile="bin/TestSuited.pdb"
SubSystem="2" SubSystem="2"
TargetMachine="1"/> TargetMachine="1"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCPostBuildEventTool"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool"/> Name="VCResourceCompilerTool"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool <Tool
Name="VCManagedWrapperGeneratorTool"/> Name="VCManagedWrapperGeneratorTool"/>
<Tool <Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
<Configuration <Configuration
Name="release_static|Win32" Name="release_static|Win32"
OutputDirectory="$(ConfigurationName)" OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="2" UseOfMFC="2"
CharacterSet="2"> CharacterSet="2">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="4" Optimization="4"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
EnableIntrinsicFunctions="TRUE" EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
OmitFramePointers="TRUE" OmitFramePointers="TRUE"
OptimizeForWindowsApplication="TRUE" OptimizeForWindowsApplication="TRUE"
AdditionalIncludeDirectories="..\include;..\..\Net\include;..\..\Foundation\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Util\include" AdditionalIncludeDirectories="..\include;..\..\Net\include;..\..\Foundation\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Util\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="FALSE" BufferSecurityCheck="FALSE"
TreatWChar_tAsBuiltInType="TRUE" TreatWChar_tAsBuiltInType="TRUE"
ForceConformanceInForLoopScope="TRUE" ForceConformanceInForLoopScope="TRUE"
RuntimeTypeInfo="TRUE" RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/> DebugInformationFormat="3"/>
<Tool <Tool
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="CppUnitmt.lib WinTestRunnermt.lib PocoFoundationmt.lib PocoNetmt.lib PocoNetSSLmt.lib PocoUtilmt.lib libeay32mt.lib ssleay32mt.lib PocoXMLmt.lib winmm.lib" AdditionalDependencies="CppUnitmt.lib WinTestRunnermt.lib PocoFoundationmt.lib PocoNetmt.lib PocoNetSSLmt.lib PocoUtilmt.lib libeay32mt.lib ssleay32mt.lib PocoXMLmt.lib winmm.lib"
OutputFile="bin/TestSuitemt.exe" OutputFile="bin/TestSuitemt.exe"
LinkIncremental="1" LinkIncremental="1"
AdditionalLibraryDirectories="..\..\lib" AdditionalLibraryDirectories="..\..\lib"
GenerateDebugInformation="FALSE" GenerateDebugInformation="FALSE"
ProgramDatabaseFile="" ProgramDatabaseFile=""
SubSystem="2" SubSystem="2"
OptimizeReferences="2" OptimizeReferences="2"
EnableCOMDATFolding="2" EnableCOMDATFolding="2"
TargetMachine="1"/> TargetMachine="1"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool
Name="VCPostBuildEventTool"/> Name="VCPostBuildEventTool"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
Name="VCPreLinkEventTool"/> Name="VCPreLinkEventTool"/>
<Tool <Tool
Name="VCResourceCompilerTool"/> Name="VCResourceCompilerTool"/>
<Tool <Tool
Name="VCWebServiceProxyGeneratorTool"/> Name="VCWebServiceProxyGeneratorTool"/>
<Tool <Tool
Name="VCXMLDataGeneratorTool"/> Name="VCXMLDataGeneratorTool"/>
<Tool <Tool
Name="VCWebDeploymentTool"/> Name="VCWebDeploymentTool"/>
<Tool <Tool
Name="VCManagedWrapperGeneratorTool"/> Name="VCManagedWrapperGeneratorTool"/>
<Tool <Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/> Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration> </Configuration>
</Configurations> </Configurations>
<References> <References>
</References> </References>
<Files> <Files>
<Filter <Filter
Name="_Suite" Name="_Suite"
Filter=""> Filter="">
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\NetSSLTestSuite.h"> RelativePath=".\src\NetSSLTestSuite.h">
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\NetSSLTestSuite.cpp"> RelativePath=".\src\NetSSLTestSuite.cpp">
</File> </File>
</Filter> </Filter>
</Filter> </Filter>
<Filter <Filter
Name="_Driver" Name="_Driver"
Filter=""> Filter="">
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\WinDriver.cpp"> RelativePath=".\src\WinDriver.cpp">
</File> </File>
</Filter> </Filter>
</Filter> </Filter>
<Filter <Filter
Name="HTTPS" Name="HTTPS"
Filter=""> Filter="">
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\HTTPSTestServer.h"> RelativePath=".\src\HTTPSTestServer.h">
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\HTTPSTestServer.cpp"> RelativePath=".\src\HTTPSTestServer.cpp">
</File> </File>
</Filter> </Filter>
</Filter> </Filter>
<Filter <Filter
Name="HTTPSClient" Name="HTTPSClient"
Filter=""> Filter="">
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\HTTPSClientSessionTest.h"> RelativePath=".\src\HTTPSClientSessionTest.h">
</File> </File>
<File <File
RelativePath=".\src\HTTPSClientTestSuite.h"> RelativePath=".\src\HTTPSClientTestSuite.h">
</File> </File>
<File <File
RelativePath=".\src\HTTPSStreamFactoryTest.h"> RelativePath=".\src\HTTPSStreamFactoryTest.h">
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\HTTPSClientSessionTest.cpp"> RelativePath=".\src\HTTPSClientSessionTest.cpp">
</File> </File>
<File <File
RelativePath=".\src\HTTPSClientTestSuite.cpp"> RelativePath=".\src\HTTPSClientTestSuite.cpp">
</File> </File>
<File <File
RelativePath=".\src\HTTPSStreamFactoryTest.cpp"> RelativePath=".\src\HTTPSStreamFactoryTest.cpp">
</File> </File>
</Filter> </Filter>
</Filter> </Filter>
<Filter <Filter
Name="HTTPServer" Name="HTTPServer"
Filter=""> Filter="">
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\HTTPSServerTest.h"> RelativePath=".\src\HTTPSServerTest.h">
</File> </File>
<File <File
RelativePath=".\src\HTTPSServerTestSuite.h"> RelativePath=".\src\HTTPSServerTestSuite.h">
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\HTTPSServerTest.cpp"> RelativePath=".\src\HTTPSServerTest.cpp">
</File> </File>
<File <File
RelativePath=".\src\HTTPSServerTestSuite.cpp"> RelativePath=".\src\HTTPSServerTestSuite.cpp">
</File> </File>
</Filter> </Filter>
</Filter> </Filter>
<Filter <Filter
Name="TCPServer" Name="TCPServer"
Filter=""> Filter="">
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\TCPServerTest.h"> RelativePath=".\src\TCPServerTest.h">
</File> </File>
<File <File
RelativePath=".\src\TCPServerTestSuite.h"> RelativePath=".\src\TCPServerTestSuite.h">
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter=""> Filter="">
<File <File
RelativePath=".\src\TCPServerTest.cpp"> RelativePath=".\src\TCPServerTest.cpp">
</File> </File>
<File <File
RelativePath=".\src\TCPServerTestSuite.cpp"> RelativePath=".\src\TCPServerTestSuite.cpp">
</File> </File>
</Filter> </Filter>
</Filter> </Filter>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>
</VisualStudioProject> </VisualStudioProject>

File diff suppressed because it is too large Load Diff

View File

@@ -1,48 +1,48 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIICaDCCAdECCQCzfxSsk7yaLjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB MIICaDCCAdECCQCzfxSsk7yaLjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB
VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV
BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA
aW5mLmNvbTAeFw0wNjAzMDExMzA3MzFaFw0wNjAzMzExMzA3MzFaMH4xCzAJBgNV aW5mLmNvbTAeFw0wNjAzMDExMzA3MzFaFw0wNjAzMzExMzA3MzFaMH4xCzAJBgNV
BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExETAPBgNVBAcTCFN0IEpha29iMRww BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExETAPBgNVBAcTCFN0IEpha29iMRww
GgYDVQQKExNBcHBsaWVkIEluZm9ybWF0aWNzMQowCAYDVQQDFAEqMR4wHAYJKoZI GgYDVQQKExNBcHBsaWVkIEluZm9ybWF0aWNzMQowCAYDVQQDFAEqMR4wHAYJKoZI
hvcNAQkBFg9pbmZvQGFwcGluZi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ hvcNAQkBFg9pbmZvQGFwcGluZi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ
AoGBAJHGyXDHyCYoWz+65ltNwwZbhwOGnxr9P1WMATuFJh0bPBZxKbZRdbTm9KhZ AoGBAJHGyXDHyCYoWz+65ltNwwZbhwOGnxr9P1WMATuFJh0bPBZxKbZRdbTm9KhZ
OlvsEIsfgiYdsxURYIqXfEgISYLZcZY0pQwGEOmB+0NeC/+ENSfOlNSthx6zSVlc OlvsEIsfgiYdsxURYIqXfEgISYLZcZY0pQwGEOmB+0NeC/+ENSfOlNSthx6zSVlc
zhJ7+dJOGwepHAiLr1fRuc5jogYLraE+lKTnqAAFfzwvti77AgMBAAEwDQYJKoZI zhJ7+dJOGwepHAiLr1fRuc5jogYLraE+lKTnqAAFfzwvti77AgMBAAEwDQYJKoZI
hvcNAQEFBQADgYEAY/ZoeY1ukkEJX7259NeoVM0oahlulWV0rlCqyaeosOiDORPT hvcNAQEFBQADgYEAY/ZoeY1ukkEJX7259NeoVM0oahlulWV0rlCqyaeosOiDORPT
m6X1w/5MTCf9VyaD1zukoSZ4QqNVjHFXcXidbB7Tgt3yRuZ5PC5LIFCDPv9mgPne m6X1w/5MTCf9VyaD1zukoSZ4QqNVjHFXcXidbB7Tgt3yRuZ5PC5LIFCDPv9mgPne
mUA70yfctNfza2z3ZiQ6NDkW3mZX+1tmxYIrJQIrkVeYeqf1Gh2nyZrUMcE= mUA70yfctNfza2z3ZiQ6NDkW3mZX+1tmxYIrJQIrkVeYeqf1Gh2nyZrUMcE=
-----END CERTIFICATE----- -----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY----- -----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,E7AE93C9E49184EA DEK-Info: DES-EDE3-CBC,E7AE93C9E49184EA
A2IqzNcWs+I5vzV+i+woDk56+yr58eU0Onw8eEvXkLjnSc58JU4327IF7yUbKWdW A2IqzNcWs+I5vzV+i+woDk56+yr58eU0Onw8eEvXkLjnSc58JU4327IF7yUbKWdW
Q7BYGGOkVFiZ7ANOwviDg5SUhxRDWCcW8dS6/p1vfdQ1C3qj2OwJjkpg0aDBIzJn Q7BYGGOkVFiZ7ANOwviDg5SUhxRDWCcW8dS6/p1vfdQ1C3qj2OwJjkpg0aDBIzJn
FzgguT3MF3ama77vxv0S3kOfmCj62MLqPGpj5pQ0/1hefRFbL8oAX8bXUN7/rmGM FzgguT3MF3ama77vxv0S3kOfmCj62MLqPGpj5pQ0/1hefRFbL8oAX8bXUN7/rmGM
Zc0QyzFZv2iQ04dY/6TNclwKPB4H0On4K+8BMs3PRkWA0clCaQaFO2+iwnk3XZfe Zc0QyzFZv2iQ04dY/6TNclwKPB4H0On4K+8BMs3PRkWA0clCaQaFO2+iwnk3XZfe
+MsKUEbLCpAQeYspYv1cw38dCdWq1KTP5aJk+oXgwjfX5cAaPTz74NTqTIsCcaTD +MsKUEbLCpAQeYspYv1cw38dCdWq1KTP5aJk+oXgwjfX5cAaPTz74NTqTIsCcaTD
3vy7ukJYFlDR9Kyo7z8rMazYrKJslhnuRH0BhK9st9McwL957j5tZmrKyraCcmCx 3vy7ukJYFlDR9Kyo7z8rMazYrKJslhnuRH0BhK9st9McwL957j5tZmrKyraCcmCx
dMAGcsis1va3ayYZpIpFqA4EhYrTM+6N8ZRfUap20+b5IQwHfTQDejUhL6rBwy7j dMAGcsis1va3ayYZpIpFqA4EhYrTM+6N8ZRfUap20+b5IQwHfTQDejUhL6rBwy7j
Ti5yD83/itoOMyXq2sV/XWfVD5zk/P5iv22O1EAQMhhnPB9K/I/JhuSGQJfn3cNh Ti5yD83/itoOMyXq2sV/XWfVD5zk/P5iv22O1EAQMhhnPB9K/I/JhuSGQJfn3cNh
ykOUYT0+vDeSeEVa+FVEP1W35G0alTbKbNs5Tb8KxJ3iDJUxokM//SvPXZy9hOVX ykOUYT0+vDeSeEVa+FVEP1W35G0alTbKbNs5Tb8KxJ3iDJUxokM//SvPXZy9hOVX
Y05imB04J15DaGbAHlNzunhuJi7121WV/JRXZRW9diE6hwpD8rwqi3FMuRUmy7U9 Y05imB04J15DaGbAHlNzunhuJi7121WV/JRXZRW9diE6hwpD8rwqi3FMuRUmy7U9
aFA5poKRAYlo9YtZ3YpFyjGKB6MfCQcB2opuSnQ/gbugV41m67uQ4CDwWLaNRkTb aFA5poKRAYlo9YtZ3YpFyjGKB6MfCQcB2opuSnQ/gbugV41m67uQ4CDwWLaNRkTb
GlsMBNcHnidg15Bsat5HaB7l250ukrI13Uw1MYdDUzaS3gPfw9aC4F2w0p3U+DPH GlsMBNcHnidg15Bsat5HaB7l250ukrI13Uw1MYdDUzaS3gPfw9aC4F2w0p3U+DPH
80/zePxtroR7T4/+rI136Rl+aMXDMOEGCX1TVP8rjuZzuRyUSUKC8Q== 80/zePxtroR7T4/+rI136Rl+aMXDMOEGCX1TVP8rjuZzuRyUSUKC8Q==
-----END RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB
VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV
BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA
aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV
BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP
MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW
C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN
Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm
k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W
jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB
AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a
+ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO +ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO
M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP
-----END CERTIFICATE----- -----END CERTIFICATE-----

View File

@@ -1,15 +1,15 @@
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB MIICXTCCAcYCCQC1Vk/N8qR4AjANBgkqhkiG9w0BAQUFADBzMQswCQYDVQQGEwJB
VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV VDESMBAGA1UECBMJQ2FyaW50aGlhMRIwEAYDVQQHEwlTdC4gSmFrb2IxDzANBgNV
BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA BAoTBkFwcEluZjEPMA0GA1UEAxMGQXBwSW5mMRowGAYJKoZIhvcNAQkBFgthcHBA
aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV aW5mLmNvbTAeFw0wNjAyMjcxMzI3MThaFw0wNjAzMjkxMzI3MThaMHMxCzAJBgNV
BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP BAYTAkFUMRIwEAYDVQQIEwlDYXJpbnRoaWExEjAQBgNVBAcTCVN0LiBKYWtvYjEP
MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW MA0GA1UEChMGQXBwSW5mMQ8wDQYDVQQDEwZBcHBJbmYxGjAYBgkqhkiG9w0BCQEW
C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN C2FwcEBpbmYuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsFXiPuicN
Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm Im4oJwF8NuaFN+lgYwcZ6dAO3ILIR3kLA2PxF8HSQLfF8J8a4odZhLhctIMAKTxm
k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W k0w8TW5qhL8QLdGzY9vzvkgdKOkan2t3sMeXJAfrM1AphTsmgntAQazGZjOj5p4W
jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB jDnxQ+VXAylqwjHh49eSBxM3wgoscF4iLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GB
AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a AIpfLdXiKchPvFMhQS8xTtXvrw5dVL3yImUMYs4GQi8RrjGmfGB3yMAR7B/b8v4a
+ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO +ztfusgWAWiUKuSGTk4S8YB0fsFlmOv0WDr+PyZ4Lui/a8opbyzGE7rqpnF/s0GO
M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP M7uLCNNwIN7WhmxcWV0KZU1wTppoSWPJda1yTbBzF9XP
-----END CERTIFICATE----- -----END CERTIFICATE-----

View File

@@ -1,84 +1,84 @@
// //
// Driver.cpp // Driver.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/Driver.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/Driver.cpp#1 $
// //
// Console-based test driver for Poco NetSSL. // Console-based test driver for Poco NetSSL.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "CppUnit/TestRunner.h" #include "CppUnit/TestRunner.h"
#include "NetSSLTestSuite.h" #include "NetSSLTestSuite.h"
#include "Poco/Util/Application.h" #include "Poco/Util/Application.h"
#include "Poco/Net/HTTPStreamFactory.h" #include "Poco/Net/HTTPStreamFactory.h"
#include "Poco/Net/HTTPSStreamFactory.h" #include "Poco/Net/HTTPSStreamFactory.h"
#include <iostream> #include <iostream>
class NetSSLApp: public Poco::Util::Application class NetSSLApp: public Poco::Util::Application
{ {
public: public:
NetSSLApp() NetSSLApp()
{ {
} }
~NetSSLApp() ~NetSSLApp()
{ {
} }
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);
} }
}; };
int main(int ac, char **av) int main(int ac, char **av)
{ {
Poco::Net::HTTPStreamFactory::registerFactory(); Poco::Net::HTTPStreamFactory::registerFactory();
Poco::Net::HTTPSStreamFactory::registerFactory(); Poco::Net::HTTPSStreamFactory::registerFactory();
NetSSLApp app; NetSSLApp app;
try try
{ {
app.init(1, av); 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; std::vector<std::string> args;
for (int i = 0; i < ac; ++i) for (int i = 0; i < ac; ++i)
args.push_back(std::string(av[i])); args.push_back(std::string(av[i]));
CppUnit::TestRunner runner; CppUnit::TestRunner runner;
runner.addTest("NetSSLTestSuite", NetSSLTestSuite::suite()); runner.addTest("NetSSLTestSuite", NetSSLTestSuite::suite());
return runner.run(args) ? 0 : 1; return runner.run(args) ? 0 : 1;
} }

View File

@@ -1,46 +1,46 @@
// //
// HTTPSClientTestSuite.cpp // HTTPSClientTestSuite.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSClientTestSuite.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSClientTestSuite.cpp#1 $
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "HTTPSClientTestSuite.h" #include "HTTPSClientTestSuite.h"
#include "HTTPSClientSessionTest.h" #include "HTTPSClientSessionTest.h"
#include "HTTPSStreamFactoryTest.h" #include "HTTPSStreamFactoryTest.h"
CppUnit::Test* HTTPSClientTestSuite::suite() CppUnit::Test* HTTPSClientTestSuite::suite()
{ {
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HTTPSClientTestSuite"); CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HTTPSClientTestSuite");
pSuite->addTest(HTTPSClientSessionTest::suite()); pSuite->addTest(HTTPSClientSessionTest::suite());
pSuite->addTest(HTTPSStreamFactoryTest::suite()); pSuite->addTest(HTTPSStreamFactoryTest::suite());
return pSuite; return pSuite;
} }

View File

@@ -1,49 +1,49 @@
// //
// HTTPSClientTestSuite.h // HTTPSClientTestSuite.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSClientTestSuite.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSClientTestSuite.h#1 $
// //
// Definition of the HTTPSClientTestSuite class. // Definition of the HTTPSClientTestSuite class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef HTTPSClientTestSuite_INCLUDED #ifndef HTTPSClientTestSuite_INCLUDED
#define HTTPSClientTestSuite_INCLUDED #define HTTPSClientTestSuite_INCLUDED
#include "CppUnit/TestSuite.h" #include "CppUnit/TestSuite.h"
class HTTPSClientTestSuite class HTTPSClientTestSuite
{ {
public: public:
static CppUnit::Test* suite(); static CppUnit::Test* suite();
}; };
#endif // HTTPSClientTestSuite_INCLUDED #endif // HTTPSClientTestSuite_INCLUDED

View File

@@ -1,421 +1,421 @@
// //
// HTTPSServerTest.cpp // HTTPSServerTest.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSServerTest.cpp#2 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSServerTest.cpp#2 $
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "HTTPSServerTest.h" #include "HTTPSServerTest.h"
#include "CppUnit/TestCaller.h" #include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h" #include "CppUnit/TestSuite.h"
#include "Poco/Net/HTTPServer.h" #include "Poco/Net/HTTPServer.h"
#include "Poco/Net/HTTPServerParams.h" #include "Poco/Net/HTTPServerParams.h"
#include "Poco/Net/HTTPRequestHandler.h" #include "Poco/Net/HTTPRequestHandler.h"
#include "Poco/Net/HTTPRequestHandlerFactory.h" #include "Poco/Net/HTTPRequestHandlerFactory.h"
#include "Poco/Net/HTTPSClientSession.h" #include "Poco/Net/HTTPSClientSession.h"
#include "Poco/Net/HTTPRequest.h" #include "Poco/Net/HTTPRequest.h"
#include "Poco/Net/HTTPServerRequest.h" #include "Poco/Net/HTTPServerRequest.h"
#include "Poco/Net/HTTPResponse.h" #include "Poco/Net/HTTPResponse.h"
#include "Poco/Net/HTTPServerResponse.h" #include "Poco/Net/HTTPServerResponse.h"
#include "Poco/Net/SecureServerSocket.h" #include "Poco/Net/SecureServerSocket.h"
#include "Poco/StreamCopier.h" #include "Poco/StreamCopier.h"
#include <sstream> #include <sstream>
using Poco::Net::HTTPServer; using Poco::Net::HTTPServer;
using Poco::Net::HTTPServerParams; using Poco::Net::HTTPServerParams;
using Poco::Net::HTTPRequestHandler; using Poco::Net::HTTPRequestHandler;
using Poco::Net::HTTPRequestHandlerFactory; using Poco::Net::HTTPRequestHandlerFactory;
using Poco::Net::HTTPSClientSession; using Poco::Net::HTTPSClientSession;
using Poco::Net::HTTPRequest; using Poco::Net::HTTPRequest;
using Poco::Net::HTTPServerRequest; using Poco::Net::HTTPServerRequest;
using Poco::Net::HTTPResponse; using Poco::Net::HTTPResponse;
using Poco::Net::HTTPServerResponse; using Poco::Net::HTTPServerResponse;
using Poco::Net::HTTPMessage; using Poco::Net::HTTPMessage;
using Poco::Net::SecureServerSocket; using Poco::Net::SecureServerSocket;
using Poco::StreamCopier; using Poco::StreamCopier;
namespace namespace
{ {
class EchoBodyRequestHandler: public HTTPRequestHandler class EchoBodyRequestHandler: public HTTPRequestHandler
{ {
public: public:
void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response) void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
{ {
if (request.getChunkedTransferEncoding()) if (request.getChunkedTransferEncoding())
response.setChunkedTransferEncoding(true); response.setChunkedTransferEncoding(true);
else if (request.getContentLength() != HTTPMessage::UNKNOWN_CONTENT_LENGTH) else if (request.getContentLength() != HTTPMessage::UNKNOWN_CONTENT_LENGTH)
response.setContentLength(request.getContentLength()); response.setContentLength(request.getContentLength());
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); int n = StreamCopier::copyStream(istr, ostr);
} }
}; };
class EchoHeaderRequestHandler: public HTTPRequestHandler class EchoHeaderRequestHandler: public HTTPRequestHandler
{ {
public: public:
void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response) void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
{ {
std::ostringstream osstr; std::ostringstream osstr;
request.write(osstr); request.write(osstr);
int n = (int) osstr.str().length(); int n = (int) osstr.str().length();
response.setContentLength(n); response.setContentLength(n);
std::ostream& ostr = response.send(); std::ostream& ostr = response.send();
if (request.getMethod() != HTTPRequest::HTTP_HEAD) if (request.getMethod() != HTTPRequest::HTTP_HEAD)
request.write(ostr); request.write(ostr);
} }
}; };
class RedirectRequestHandler: public HTTPRequestHandler class RedirectRequestHandler: public HTTPRequestHandler
{ {
public: public:
void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response) void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
{ {
response.redirect("http://www.appinf.com/"); response.redirect("http://www.appinf.com/");
} }
}; };
class AuthRequestHandler: public HTTPRequestHandler class AuthRequestHandler: public HTTPRequestHandler
{ {
public: public:
void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response) void handleRequest(HTTPServerRequest& request, HTTPServerResponse& response)
{ {
response.requireAuthentication("/auth"); response.requireAuthentication("/auth");
response.send(); response.send();
} }
}; };
class RequestHandlerFactory: public HTTPRequestHandlerFactory class RequestHandlerFactory: public HTTPRequestHandlerFactory
{ {
public: public:
HTTPRequestHandler* createRequestHandler(const HTTPServerRequest& request) HTTPRequestHandler* createRequestHandler(const HTTPServerRequest& request)
{ {
if (request.getURI() == "/echoBody") if (request.getURI() == "/echoBody")
return new EchoBodyRequestHandler; return new EchoBodyRequestHandler;
else if (request.getURI() == "/echoHeader") else if (request.getURI() == "/echoHeader")
return new EchoHeaderRequestHandler; return new EchoHeaderRequestHandler;
else if (request.getURI() == "/redirect") else if (request.getURI() == "/redirect")
return new RedirectRequestHandler(); return new RedirectRequestHandler();
else if (request.getURI() == "/auth") else if (request.getURI() == "/auth")
return new AuthRequestHandler(); return new AuthRequestHandler();
else else
return 0; return 0;
} }
}; };
} }
HTTPSServerTest::HTTPSServerTest(const std::string& name): CppUnit::TestCase(name) HTTPSServerTest::HTTPSServerTest(const std::string& name): CppUnit::TestCase(name)
{ {
} }
HTTPSServerTest::~HTTPSServerTest() HTTPSServerTest::~HTTPSServerTest()
{ {
} }
void HTTPSServerTest::testIdentityRequest() void HTTPSServerTest::testIdentityRequest()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
HTTPServerParams* pParams = new HTTPServerParams; HTTPServerParams* pParams = new HTTPServerParams;
pParams->setKeepAlive(false); pParams->setKeepAlive(false);
HTTPServer srv(new RequestHandlerFactory, svs, pParams); HTTPServer srv(new RequestHandlerFactory, svs, pParams);
srv.start(); srv.start();
HTTPSClientSession cs("localhost", svs.address().port()); HTTPSClientSession cs("localhost", svs.address().port());
std::string body(5000, 'x'); std::string body(5000, 'x');
HTTPRequest request("POST", "/echoBody"); HTTPRequest request("POST", "/echoBody");
request.setContentLength((int) body.length()); request.setContentLength((int) body.length());
request.setContentType("text/plain"); request.setContentType("text/plain");
cs.sendRequest(request) << body; cs.sendRequest(request) << body;
HTTPResponse response; HTTPResponse response;
std::string rbody; std::string rbody;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getContentLength() == body.size()); assert (response.getContentLength() == body.size());
assert (response.getContentType() == "text/plain"); assert (response.getContentType() == "text/plain");
assert (rbody == body); assert (rbody == body);
} }
void HTTPSServerTest::testChunkedRequest() void HTTPSServerTest::testChunkedRequest()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
HTTPServerParams* pParams = new HTTPServerParams; HTTPServerParams* pParams = new HTTPServerParams;
pParams->setKeepAlive(false); pParams->setKeepAlive(false);
HTTPServer srv(new RequestHandlerFactory, svs, pParams); HTTPServer srv(new RequestHandlerFactory, svs, pParams);
srv.start(); srv.start();
HTTPSClientSession cs("localhost", svs.address().port()); HTTPSClientSession cs("localhost", svs.address().port());
std::string body(5000, 'x'); std::string body(5000, 'x');
HTTPRequest request("POST", "/echoBody"); HTTPRequest request("POST", "/echoBody");
request.setContentType("text/plain"); request.setContentType("text/plain");
request.setChunkedTransferEncoding(true); request.setChunkedTransferEncoding(true);
cs.sendRequest(request) << body; cs.sendRequest(request) << body;
HTTPResponse response; HTTPResponse response;
std::string rbody; std::string rbody;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH);
assert (response.getContentType() == "text/plain"); assert (response.getContentType() == "text/plain");
assert (response.getChunkedTransferEncoding()); assert (response.getChunkedTransferEncoding());
assert (rbody == body); assert (rbody == body);
} }
void HTTPSServerTest::testClosedRequest() void HTTPSServerTest::testClosedRequest()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
HTTPServerParams* pParams = new HTTPServerParams; HTTPServerParams* pParams = new HTTPServerParams;
pParams->setKeepAlive(false); pParams->setKeepAlive(false);
HTTPServer srv(new RequestHandlerFactory, svs, pParams); HTTPServer srv(new RequestHandlerFactory, svs, pParams);
srv.start(); srv.start();
HTTPSClientSession cs("localhost", svs.address().port()); HTTPSClientSession cs("localhost", svs.address().port());
std::string body(5000, 'x'); std::string body(5000, 'x');
HTTPRequest request("POST", "/echoBody"); HTTPRequest request("POST", "/echoBody");
request.setContentType("text/plain"); request.setContentType("text/plain");
cs.sendRequest(request) << body; cs.sendRequest(request) << body;
HTTPResponse response; HTTPResponse response;
std::string rbody; std::string rbody;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH);
assert (response.getContentType() == "text/plain"); assert (response.getContentType() == "text/plain");
assert (!response.getChunkedTransferEncoding()); assert (!response.getChunkedTransferEncoding());
assert (rbody == body); assert (rbody == body);
} }
void HTTPSServerTest::testIdentityRequestKeepAlive() void HTTPSServerTest::testIdentityRequestKeepAlive()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
HTTPServerParams* pParams = new HTTPServerParams; HTTPServerParams* pParams = new HTTPServerParams;
pParams->setKeepAlive(true); pParams->setKeepAlive(true);
HTTPServer srv(new RequestHandlerFactory, svs, pParams); HTTPServer srv(new RequestHandlerFactory, svs, pParams);
srv.start(); srv.start();
HTTPSClientSession cs("localhost", svs.address().port()); HTTPSClientSession cs("localhost", svs.address().port());
cs.setKeepAlive(true); cs.setKeepAlive(true);
std::string body(5000, 'x'); std::string body(5000, 'x');
HTTPRequest request("POST", "/echoBody", HTTPMessage::HTTP_1_1); HTTPRequest request("POST", "/echoBody", HTTPMessage::HTTP_1_1);
request.setContentLength((int) body.length()); request.setContentLength((int) body.length());
request.setContentType("text/plain"); request.setContentType("text/plain");
cs.sendRequest(request) << body; cs.sendRequest(request) << body;
HTTPResponse response; HTTPResponse response;
std::string rbody; std::string rbody;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getContentLength() == body.size()); assert (response.getContentLength() == body.size());
assert (response.getContentType() == "text/plain"); assert (response.getContentType() == "text/plain");
assert (response.getKeepAlive()); assert (response.getKeepAlive());
assert (rbody == body); assert (rbody == body);
body.assign(1000, 'y'); body.assign(1000, 'y');
request.setContentLength((int) body.length()); request.setContentLength((int) body.length());
request.setKeepAlive(false); request.setKeepAlive(false);
cs.sendRequest(request) << body; cs.sendRequest(request) << body;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getContentLength() == body.size()); assert (response.getContentLength() == body.size());
assert (response.getContentType() == "text/plain"); assert (response.getContentType() == "text/plain");
assert (!response.getKeepAlive()); assert (!response.getKeepAlive());
assert (rbody == body);} assert (rbody == body);}
void HTTPSServerTest::testChunkedRequestKeepAlive() void HTTPSServerTest::testChunkedRequestKeepAlive()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
HTTPServerParams* pParams = new HTTPServerParams; HTTPServerParams* pParams = new HTTPServerParams;
pParams->setKeepAlive(true); pParams->setKeepAlive(true);
HTTPServer srv(new RequestHandlerFactory, svs, pParams); HTTPServer srv(new RequestHandlerFactory, svs, pParams);
srv.start(); srv.start();
HTTPSClientSession cs("localhost", svs.address().port()); HTTPSClientSession cs("localhost", svs.address().port());
cs.setKeepAlive(true); cs.setKeepAlive(true);
std::string body(5000, 'x'); std::string body(5000, 'x');
HTTPRequest request("POST", "/echoBody", HTTPMessage::HTTP_1_1); HTTPRequest request("POST", "/echoBody", HTTPMessage::HTTP_1_1);
request.setContentType("text/plain"); request.setContentType("text/plain");
request.setChunkedTransferEncoding(true); request.setChunkedTransferEncoding(true);
cs.sendRequest(request) << body; cs.sendRequest(request) << body;
HTTPResponse response; HTTPResponse response;
std::string rbody; std::string rbody;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH);
assert (response.getContentType() == "text/plain"); assert (response.getContentType() == "text/plain");
assert (response.getChunkedTransferEncoding()); assert (response.getChunkedTransferEncoding());
assert (rbody == body); assert (rbody == body);
body.assign(1000, 'y'); body.assign(1000, 'y');
request.setKeepAlive(false); request.setKeepAlive(false);
cs.sendRequest(request) << body; cs.sendRequest(request) << body;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH);
assert (response.getContentType() == "text/plain"); assert (response.getContentType() == "text/plain");
assert (response.getChunkedTransferEncoding()); assert (response.getChunkedTransferEncoding());
assert (!response.getKeepAlive()); assert (!response.getKeepAlive());
assert (rbody == body); assert (rbody == body);
} }
void HTTPSServerTest::testClosedRequestKeepAlive() void HTTPSServerTest::testClosedRequestKeepAlive()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
HTTPServerParams* pParams = new HTTPServerParams; HTTPServerParams* pParams = new HTTPServerParams;
pParams->setKeepAlive(true); pParams->setKeepAlive(true);
HTTPServer srv(new RequestHandlerFactory, svs, pParams); HTTPServer srv(new RequestHandlerFactory, svs, pParams);
srv.start(); srv.start();
HTTPSClientSession cs("localhost", svs.address().port()); HTTPSClientSession cs("localhost", svs.address().port());
std::string body(5000, 'x'); std::string body(5000, 'x');
HTTPRequest request("POST", "/echoBody"); HTTPRequest request("POST", "/echoBody");
request.setContentType("text/plain"); request.setContentType("text/plain");
cs.sendRequest(request) << body; cs.sendRequest(request) << body;
HTTPResponse response; HTTPResponse response;
std::string rbody; std::string rbody;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH); assert (response.getContentLength() == HTTPMessage::UNKNOWN_CONTENT_LENGTH);
assert (response.getContentType() == "text/plain"); assert (response.getContentType() == "text/plain");
assert (!response.getChunkedTransferEncoding()); assert (!response.getChunkedTransferEncoding());
assert (!response.getKeepAlive()); assert (!response.getKeepAlive());
assert (rbody == body); assert (rbody == body);
int n = (int) rbody.size(); int n = (int) rbody.size();
} }
void HTTPSServerTest::test100Continue() void HTTPSServerTest::test100Continue()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
HTTPServerParams* pParams = new HTTPServerParams; HTTPServerParams* pParams = new HTTPServerParams;
pParams->setKeepAlive(false); pParams->setKeepAlive(false);
HTTPServer srv(new RequestHandlerFactory, svs, pParams); HTTPServer srv(new RequestHandlerFactory, svs, pParams);
srv.start(); srv.start();
HTTPSClientSession cs("localhost", svs.address().port()); HTTPSClientSession cs("localhost", svs.address().port());
std::string body(5000, 'x'); std::string body(5000, 'x');
HTTPRequest request("POST", "/echoBody"); HTTPRequest request("POST", "/echoBody");
request.setContentLength((int) body.length()); request.setContentLength((int) body.length());
request.setContentType("text/plain"); request.setContentType("text/plain");
request.set("Expect", "100-Continue"); request.set("Expect", "100-Continue");
cs.sendRequest(request) << body; cs.sendRequest(request) << body;
HTTPResponse response; HTTPResponse response;
std::string rbody; std::string rbody;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getContentLength() == body.size()); assert (response.getContentLength() == body.size());
assert (response.getContentType() == "text/plain"); assert (response.getContentType() == "text/plain");
assert (rbody == body); assert (rbody == body);
} }
void HTTPSServerTest::testRedirect() void HTTPSServerTest::testRedirect()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
HTTPServerParams* pParams = new HTTPServerParams; HTTPServerParams* pParams = new HTTPServerParams;
pParams->setKeepAlive(false); pParams->setKeepAlive(false);
HTTPServer srv(new RequestHandlerFactory, svs, pParams); HTTPServer srv(new RequestHandlerFactory, svs, pParams);
srv.start(); srv.start();
HTTPSClientSession cs("localhost", svs.address().port()); HTTPSClientSession cs("localhost", svs.address().port());
HTTPRequest request("GET", "/redirect"); HTTPRequest request("GET", "/redirect");
cs.sendRequest(request); cs.sendRequest(request);
HTTPResponse response; HTTPResponse response;
std::string rbody; std::string rbody;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getStatus() == HTTPResponse::HTTP_FOUND); assert (response.getStatus() == HTTPResponse::HTTP_FOUND);
assert (response.get("Location") == "http://www.appinf.com/"); assert (response.get("Location") == "http://www.appinf.com/");
assert (rbody.empty()); assert (rbody.empty());
} }
void HTTPSServerTest::testAuth() void HTTPSServerTest::testAuth()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
HTTPServerParams* pParams = new HTTPServerParams; HTTPServerParams* pParams = new HTTPServerParams;
pParams->setKeepAlive(false); pParams->setKeepAlive(false);
HTTPServer srv(new RequestHandlerFactory, svs, pParams); HTTPServer srv(new RequestHandlerFactory, svs, pParams);
srv.start(); srv.start();
HTTPSClientSession cs("localhost", svs.address().port()); HTTPSClientSession cs("localhost", svs.address().port());
HTTPRequest request("GET", "/auth"); HTTPRequest request("GET", "/auth");
cs.sendRequest(request); cs.sendRequest(request);
HTTPResponse response; HTTPResponse response;
std::string rbody; std::string rbody;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getStatus() == HTTPResponse::HTTP_UNAUTHORIZED); assert (response.getStatus() == HTTPResponse::HTTP_UNAUTHORIZED);
assert (response.get("WWW-Authenticate") == "Basic realm=\"/auth\""); assert (response.get("WWW-Authenticate") == "Basic realm=\"/auth\"");
assert (rbody.empty()); assert (rbody.empty());
} }
void HTTPSServerTest::testNotImpl() void HTTPSServerTest::testNotImpl()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
HTTPServerParams* pParams = new HTTPServerParams; HTTPServerParams* pParams = new HTTPServerParams;
pParams->setKeepAlive(false); pParams->setKeepAlive(false);
HTTPServer srv(new RequestHandlerFactory, svs, pParams); HTTPServer srv(new RequestHandlerFactory, svs, pParams);
srv.start(); srv.start();
HTTPSClientSession cs("localhost", svs.address().port()); HTTPSClientSession cs("localhost", svs.address().port());
HTTPRequest request("GET", "/notImpl"); HTTPRequest request("GET", "/notImpl");
cs.sendRequest(request); cs.sendRequest(request);
HTTPResponse response; HTTPResponse response;
std::string rbody; std::string rbody;
cs.receiveResponse(response) >> rbody; cs.receiveResponse(response) >> rbody;
assert (response.getStatus() == HTTPResponse::HTTP_NOT_IMPLEMENTED); assert (response.getStatus() == HTTPResponse::HTTP_NOT_IMPLEMENTED);
assert (rbody.empty()); assert (rbody.empty());
} }
void HTTPSServerTest::setUp() void HTTPSServerTest::setUp()
{ {
} }
void HTTPSServerTest::tearDown() void HTTPSServerTest::tearDown()
{ {
} }
CppUnit::Test* HTTPSServerTest::suite() CppUnit::Test* HTTPSServerTest::suite()
{ {
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HTTPSServerTest"); CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HTTPSServerTest");
CppUnit_addTest(pSuite, HTTPSServerTest, testIdentityRequest); CppUnit_addTest(pSuite, HTTPSServerTest, testIdentityRequest);
CppUnit_addTest(pSuite, HTTPSServerTest, testChunkedRequest); CppUnit_addTest(pSuite, HTTPSServerTest, testChunkedRequest);
CppUnit_addTest(pSuite, HTTPSServerTest, testClosedRequest); CppUnit_addTest(pSuite, HTTPSServerTest, testClosedRequest);
CppUnit_addTest(pSuite, HTTPSServerTest, testIdentityRequestKeepAlive); CppUnit_addTest(pSuite, HTTPSServerTest, testIdentityRequestKeepAlive);
CppUnit_addTest(pSuite, HTTPSServerTest, testChunkedRequestKeepAlive); CppUnit_addTest(pSuite, HTTPSServerTest, testChunkedRequestKeepAlive);
CppUnit_addTest(pSuite, HTTPSServerTest, testClosedRequestKeepAlive); CppUnit_addTest(pSuite, HTTPSServerTest, testClosedRequestKeepAlive);
CppUnit_addTest(pSuite, HTTPSServerTest, test100Continue); CppUnit_addTest(pSuite, HTTPSServerTest, test100Continue);
CppUnit_addTest(pSuite, HTTPSServerTest, testRedirect); CppUnit_addTest(pSuite, HTTPSServerTest, testRedirect);
CppUnit_addTest(pSuite, HTTPSServerTest, testAuth); CppUnit_addTest(pSuite, HTTPSServerTest, testAuth);
CppUnit_addTest(pSuite, HTTPSServerTest, testNotImpl); CppUnit_addTest(pSuite, HTTPSServerTest, testNotImpl);
return pSuite; return pSuite;
} }

View File

@@ -1,69 +1,69 @@
// //
// HTTPSServerTest.h // HTTPSServerTest.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSServerTest.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSServerTest.h#1 $
// //
// Definition of the HTTPSServerTest class. // Definition of the HTTPSServerTest class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef HTTPSServerTest_INCLUDED #ifndef HTTPSServerTest_INCLUDED
#define HTTPSServerTest_INCLUDED #define HTTPSServerTest_INCLUDED
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
#include "CppUnit/TestCase.h" #include "CppUnit/TestCase.h"
class HTTPSServerTest: public CppUnit::TestCase class HTTPSServerTest: public CppUnit::TestCase
{ {
public: public:
HTTPSServerTest(const std::string& name); HTTPSServerTest(const std::string& name);
~HTTPSServerTest(); ~HTTPSServerTest();
void testIdentityRequest(); void testIdentityRequest();
void testChunkedRequest(); void testChunkedRequest();
void testClosedRequest(); void testClosedRequest();
void testIdentityRequestKeepAlive(); void testIdentityRequestKeepAlive();
void testChunkedRequestKeepAlive(); void testChunkedRequestKeepAlive();
void testClosedRequestKeepAlive(); void testClosedRequestKeepAlive();
void test100Continue(); void test100Continue();
void testRedirect(); void testRedirect();
void testAuth(); void testAuth();
void testNotImpl(); void testNotImpl();
void setUp(); void setUp();
void tearDown(); void tearDown();
static CppUnit::Test* suite(); static CppUnit::Test* suite();
private: private:
}; };
#endif // HTTPSServerTest_INCLUDED #endif // HTTPSServerTest_INCLUDED

View File

@@ -1,44 +1,44 @@
// //
// HTTPSServerTestSuite.cpp // HTTPSServerTestSuite.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSServerTestSuite.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSServerTestSuite.cpp#1 $
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "HTTPSServerTestSuite.h" #include "HTTPSServerTestSuite.h"
#include "HTTPSServerTest.h" #include "HTTPSServerTest.h"
CppUnit::Test* HTTPSServerTestSuite::suite() CppUnit::Test* HTTPSServerTestSuite::suite()
{ {
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HTTPSServerTestSuite"); CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HTTPSServerTestSuite");
pSuite->addTest(HTTPSServerTest::suite()); pSuite->addTest(HTTPSServerTest::suite());
return pSuite; return pSuite;
} }

View File

@@ -1,49 +1,49 @@
// //
// HTTPSServerTestSuite.h // HTTPSServerTestSuite.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSServerTestSuite.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSServerTestSuite.h#1 $
// //
// Definition of the HTTPSServerTestSuite class. // Definition of the HTTPSServerTestSuite class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef HTTPSServerTestSuite_INCLUDED #ifndef HTTPSServerTestSuite_INCLUDED
#define HTTPSServerTestSuite_INCLUDED #define HTTPSServerTestSuite_INCLUDED
#include "CppUnit/TestSuite.h" #include "CppUnit/TestSuite.h"
class HTTPSServerTestSuite class HTTPSServerTestSuite
{ {
public: public:
static CppUnit::Test* suite(); static CppUnit::Test* suite();
}; };
#endif // HTTPSServerTestSuite_INCLUDED #endif // HTTPSServerTestSuite_INCLUDED

View File

@@ -1,153 +1,153 @@
// //
// HTTPSStreamFactoryTest.cpp // HTTPSStreamFactoryTest.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSStreamFactoryTest.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSStreamFactoryTest.cpp#1 $
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "HTTPSStreamFactoryTest.h" #include "HTTPSStreamFactoryTest.h"
#include "CppUnit/TestCaller.h" #include "CppUnit/TestCaller.h"
#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/URI.h" #include "Poco/URI.h"
#include "Poco/Exception.h" #include "Poco/Exception.h"
#include "Poco/StreamCopier.h" #include "Poco/StreamCopier.h"
#include "HTTPSTestServer.h" #include "HTTPSTestServer.h"
#include <sstream> #include <sstream>
#include <memory> #include <memory>
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::URI; using Poco::URI;
using Poco::StreamCopier; using Poco::StreamCopier;
HTTPSStreamFactoryTest::HTTPSStreamFactoryTest(const std::string& name): CppUnit::TestCase(name) HTTPSStreamFactoryTest::HTTPSStreamFactoryTest(const std::string& name): CppUnit::TestCase(name)
{ {
} }
HTTPSStreamFactoryTest::~HTTPSStreamFactoryTest() HTTPSStreamFactoryTest::~HTTPSStreamFactoryTest()
{ {
} }
void HTTPSStreamFactoryTest::testNoRedirect() void HTTPSStreamFactoryTest::testNoRedirect()
{ {
HTTPSTestServer server; HTTPSTestServer server;
HTTPSStreamFactory factory; HTTPSStreamFactory factory;
URI uri("https://localhost/large"); URI uri("https://localhost/large");
uri.setPort(server.port()); uri.setPort(server.port());
std::auto_ptr<std::istream> pStr(factory.open(uri)); std::auto_ptr<std::istream> pStr(factory.open(uri));
std::ostringstream ostr; std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr); StreamCopier::copyStream(*pStr.get(), ostr);
assert (ostr.str() == HTTPSTestServer::LARGE_BODY); assert (ostr.str() == HTTPSTestServer::LARGE_BODY);
} }
void HTTPSStreamFactoryTest::testEmptyPath() void HTTPSStreamFactoryTest::testEmptyPath()
{ {
HTTPSTestServer server; HTTPSTestServer server;
HTTPSStreamFactory factory; HTTPSStreamFactory factory;
URI uri("https://localhost"); URI uri("https://localhost");
uri.setPort(server.port()); uri.setPort(server.port());
std::auto_ptr<std::istream> pStr(factory.open(uri)); std::auto_ptr<std::istream> pStr(factory.open(uri));
std::ostringstream ostr; std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr); StreamCopier::copyStream(*pStr.get(), ostr);
assert (ostr.str() == HTTPSTestServer::SMALL_BODY); assert (ostr.str() == HTTPSTestServer::SMALL_BODY);
} }
void HTTPSStreamFactoryTest::testRedirect() void HTTPSStreamFactoryTest::testRedirect()
{ {
HTTPSTestServer server; HTTPSTestServer server;
HTTPSStreamFactory factory; HTTPSStreamFactory factory;
URI uri("https://localhost/redirect"); URI uri("https://localhost/redirect");
uri.setPort(server.port()); uri.setPort(server.port());
std::auto_ptr<std::istream> pStr(factory.open(uri)); std::auto_ptr<std::istream> pStr(factory.open(uri));
std::ostringstream ostr; std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr); StreamCopier::copyStream(*pStr.get(), ostr);
assert (ostr.str() == HTTPSTestServer::LARGE_BODY); assert (ostr.str() == HTTPSTestServer::LARGE_BODY);
} }
void HTTPSStreamFactoryTest::testProxy() void HTTPSStreamFactoryTest::testProxy()
{ {
HTTPSTestServer server; HTTPSTestServer server;
HTTPSStreamFactory factory("proxy.aon.at", 8080); HTTPSStreamFactory factory("proxy.aon.at", 8080);
URI uri("https://wwws.appinf.com/"); URI uri("https://wwws.appinf.com/");
std::auto_ptr<std::istream> pStr(factory.open(uri)); std::auto_ptr<std::istream> pStr(factory.open(uri));
std::ostringstream ostr; std::ostringstream ostr;
StreamCopier::copyStream(*pStr.get(), ostr); StreamCopier::copyStream(*pStr.get(), ostr);
assert (ostr.str().length() > 0); assert (ostr.str().length() > 0);
} }
void HTTPSStreamFactoryTest::testError() void HTTPSStreamFactoryTest::testError()
{ {
HTTPSTestServer server; HTTPSTestServer server;
HTTPSStreamFactory factory; HTTPSStreamFactory factory;
URI uri("https://localhost/notfound"); URI uri("https://localhost/notfound");
uri.setPort(server.port()); uri.setPort(server.port());
try try
{ {
std::istream* pStr = factory.open(uri); std::istream* pStr = factory.open(uri);
fail("not found - must throw"); fail("not found - must throw");
} }
catch (HTTPException& exc) catch (HTTPException& exc)
{ {
std::string m = exc.displayText(); std::string m = exc.displayText();
} }
} }
void HTTPSStreamFactoryTest::setUp() void HTTPSStreamFactoryTest::setUp()
{ {
} }
void HTTPSStreamFactoryTest::tearDown() void HTTPSStreamFactoryTest::tearDown()
{ {
} }
CppUnit::Test* HTTPSStreamFactoryTest::suite() CppUnit::Test* HTTPSStreamFactoryTest::suite()
{ {
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HTTPSStreamFactoryTest"); CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("HTTPSStreamFactoryTest");
CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testNoRedirect); CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testNoRedirect);
CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testEmptyPath); CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testEmptyPath);
CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testRedirect); CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testRedirect);
CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testProxy); CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testProxy);
CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testError); CppUnit_addTest(pSuite, HTTPSStreamFactoryTest, testError);
return pSuite; return pSuite;
} }

View File

@@ -1,64 +1,64 @@
// //
// HTTPSStreamFactoryTest.h // HTTPSStreamFactoryTest.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSStreamFactoryTest.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSStreamFactoryTest.h#1 $
// //
// Definition of the HTTPSStreamFactoryTest class. // Definition of the HTTPSStreamFactoryTest class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef HTTPSStreamFactoryTest_INCLUDED #ifndef HTTPSStreamFactoryTest_INCLUDED
#define HTTPSStreamFactoryTest_INCLUDED #define HTTPSStreamFactoryTest_INCLUDED
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
#include "CppUnit/TestCase.h" #include "CppUnit/TestCase.h"
class HTTPSStreamFactoryTest: public CppUnit::TestCase class HTTPSStreamFactoryTest: public CppUnit::TestCase
{ {
public: public:
HTTPSStreamFactoryTest(const std::string& name); HTTPSStreamFactoryTest(const std::string& name);
~HTTPSStreamFactoryTest(); ~HTTPSStreamFactoryTest();
void testNoRedirect(); void testNoRedirect();
void testEmptyPath(); void testEmptyPath();
void testRedirect(); void testRedirect();
void testProxy(); void testProxy();
void testError(); void testError();
void setUp(); void setUp();
void tearDown(); void tearDown();
static CppUnit::Test* suite(); static CppUnit::Test* suite();
private: private:
}; };
#endif // HTTPSStreamFactoryTest_INCLUDED #endif // HTTPSStreamFactoryTest_INCLUDED

View File

@@ -1,241 +1,241 @@
// //
// HTTPSTestServer.cpp // HTTPSTestServer.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSTestServer.cpp#3 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSTestServer.cpp#3 $
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "HTTPSTestServer.h" #include "HTTPSTestServer.h"
#include "Poco/Net/SecureStreamSocket.h" #include "Poco/Net/SecureStreamSocket.h"
#include "Poco/Net/SocketAddress.h" #include "Poco/Net/SocketAddress.h"
#include "Poco/Timespan.h" #include "Poco/Timespan.h"
#include "Poco/NumberFormatter.h" #include "Poco/NumberFormatter.h"
#include <iostream> #include <iostream>
using Poco::Net::Socket; using Poco::Net::Socket;
using Poco::Net::StreamSocket; 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::NumberFormatter; using Poco::NumberFormatter;
const std::string HTTPSTestServer::SMALL_BODY("This is some random text data returned by the server"); const std::string HTTPSTestServer::SMALL_BODY("This is some random text data returned by the server");
const std::string HTTPSTestServer::LARGE_BODY(4000, 'x'); const std::string HTTPSTestServer::LARGE_BODY(4000, 'x');
HTTPSTestServer::HTTPSTestServer(): HTTPSTestServer::HTTPSTestServer():
_socket(SocketAddress()), _socket(SocketAddress()),
_thread("HTTPSTestServer"), _thread("HTTPSTestServer"),
_stop(false) _stop(false)
{ {
_thread.start(*this); _thread.start(*this);
_ready.wait(); _ready.wait();
_lastRequest.reserve(4000); _lastRequest.reserve(4000);
} }
HTTPSTestServer::~HTTPSTestServer() HTTPSTestServer::~HTTPSTestServer()
{ {
_stop = true; _stop = true;
_thread.join(); _thread.join();
} }
Poco::UInt16 HTTPSTestServer::port() const Poco::UInt16 HTTPSTestServer::port() const
{ {
return _socket.address().port(); return _socket.address().port();
} }
const std::string& HTTPSTestServer::lastRequest() const const std::string& HTTPSTestServer::lastRequest() const
{ {
return _lastRequest; return _lastRequest;
} }
void HTTPSTestServer::run() void HTTPSTestServer::run()
{ {
_ready.set(); _ready.set();
Poco::Timespan span(250000); Poco::Timespan span(250000);
while (!_stop) while (!_stop)
{ {
if (_socket.poll(span, Socket::SELECT_READ)) if (_socket.poll(span, Socket::SELECT_READ))
{ {
StreamSocket ss = _socket.acceptConnection(); StreamSocket ss = _socket.acceptConnection();
try try
{ {
_lastRequest.clear(); _lastRequest.clear();
char buffer[256]; char buffer[256];
int n = ss.receiveBytes(buffer, sizeof(buffer)); int n = ss.receiveBytes(buffer, sizeof(buffer));
while (n > 0 && !_stop) while (n > 0 && !_stop)
{ {
_lastRequest.append(buffer, n); _lastRequest.append(buffer, n);
if (!requestComplete()) if (!requestComplete())
n = ss.receiveBytes(buffer, sizeof(buffer)); n = ss.receiveBytes(buffer, sizeof(buffer));
else else
n = 0; n = 0;
} }
std::string response = handleRequest(); std::string response = handleRequest();
ss.sendBytes(response.data(), (int) response.size()); ss.sendBytes(response.data(), (int) response.size());
Poco::Thread::sleep(1000); Poco::Thread::sleep(1000);
} }
catch (Poco::Exception& exc) catch (Poco::Exception& exc)
{ {
std::cerr << "HTTPSTestServer: " << exc.displayText() << std::endl; std::cerr << "HTTPSTestServer: " << exc.displayText() << std::endl;
} }
} }
} }
} }
bool HTTPSTestServer::requestComplete() const bool HTTPSTestServer::requestComplete() const
{ {
return ((_lastRequest.substr(0, 3) == "GET" || _lastRequest.substr(0, 4) == "HEAD") && return ((_lastRequest.substr(0, 3) == "GET" || _lastRequest.substr(0, 4) == "HEAD") &&
(_lastRequest.find("\r\n\r\n") != std::string::npos)) || (_lastRequest.find("\r\n\r\n") != std::string::npos)) ||
(_lastRequest.find("\r\n0\r\n") != std::string::npos); (_lastRequest.find("\r\n0\r\n") != std::string::npos);
} }
std::string HTTPSTestServer::handleRequest() const std::string HTTPSTestServer::handleRequest() const
{ {
std::string response; std::string response;
response.reserve(16000); response.reserve(16000);
if (_lastRequest.substr(0, 10) == "GET /small" || if (_lastRequest.substr(0, 10) == "GET /small" ||
_lastRequest.substr(0, 11) == "HEAD /small") _lastRequest.substr(0, 11) == "HEAD /small")
{ {
std::string body(SMALL_BODY); std::string body(SMALL_BODY);
response.append("HTTP/1.0 200 OK\r\n"); response.append("HTTP/1.0 200 OK\r\n");
response.append("Content-Type: text/plain\r\n"); response.append("Content-Type: text/plain\r\n");
response.append("Content-Length: "); response.append("Content-Length: ");
response.append(NumberFormatter::format((int) body.size())); response.append(NumberFormatter::format((int) body.size()));
response.append("\r\n"); response.append("\r\n");
response.append("Connection: Close\r\n"); response.append("Connection: Close\r\n");
response.append("\r\n"); response.append("\r\n");
if (_lastRequest.substr(0, 3) == "GET") if (_lastRequest.substr(0, 3) == "GET")
response.append(body); response.append(body);
} }
else if (_lastRequest.substr(0, 10) == "GET /large" || else if (_lastRequest.substr(0, 10) == "GET /large" ||
_lastRequest.substr(0, 11) == "HEAD /large" || _lastRequest.substr(0, 11) == "HEAD /large" ||
_lastRequest.substr(0, 36) == "GET http://www.somehost.com:80/large") _lastRequest.substr(0, 36) == "GET http://www.somehost.com:80/large")
{ {
std::string body(LARGE_BODY); std::string body(LARGE_BODY);
response.append("HTTP/1.0 200 OK\r\n"); response.append("HTTP/1.0 200 OK\r\n");
response.append("Content-Type: text/plain\r\n"); response.append("Content-Type: text/plain\r\n");
response.append("Content-Length: "); response.append("Content-Length: ");
response.append(NumberFormatter::format((int) body.size())); response.append(NumberFormatter::format((int) body.size()));
response.append("\r\n"); response.append("\r\n");
response.append("Connection: Close\r\n"); response.append("Connection: Close\r\n");
response.append("\r\n"); response.append("\r\n");
if (_lastRequest.substr(0, 3) == "GET") if (_lastRequest.substr(0, 3) == "GET")
response.append(body); response.append(body);
} }
else if (_lastRequest.substr(0, 4) == "POST") else if (_lastRequest.substr(0, 4) == "POST")
{ {
std::string::size_type pos = _lastRequest.find("\r\n\r\n"); std::string::size_type pos = _lastRequest.find("\r\n\r\n");
pos += 4; pos += 4;
std::string body = _lastRequest.substr(pos); std::string body = _lastRequest.substr(pos);
response.append("HTTP/1.0 200 OK\r\n"); response.append("HTTP/1.0 200 OK\r\n");
response.append("Content-Type: text/plain\r\n"); response.append("Content-Type: text/plain\r\n");
if (_lastRequest.find("Content-Length") != std::string::npos) if (_lastRequest.find("Content-Length") != std::string::npos)
{ {
response.append("Content-Length: "); response.append("Content-Length: ");
response.append(NumberFormatter::format((int) body.size())); response.append(NumberFormatter::format((int) body.size()));
response.append("\r\n"); response.append("\r\n");
} }
else if (_lastRequest.find("chunked") != std::string::npos) else if (_lastRequest.find("chunked") != std::string::npos)
{ {
response.append("Transfer-Encoding: chunked\r\n"); response.append("Transfer-Encoding: chunked\r\n");
} }
if (_lastRequest.substr(0,15) == "POST /keepAlive") if (_lastRequest.substr(0,15) == "POST /keepAlive")
response.append("Connection: keep-alive\r\n"); response.append("Connection: keep-alive\r\n");
else else
response.append("Connection: Close\r\n"); response.append("Connection: Close\r\n");
response.append("\r\n"); response.append("\r\n");
response.append(body); response.append(body);
} }
else if (_lastRequest.substr(0, 15) == "HEAD /keepAlive") else if (_lastRequest.substr(0, 15) == "HEAD /keepAlive")
{ {
std::string body(SMALL_BODY); std::string body(SMALL_BODY);
response.append("HTTP/1.1 200 OK\r\n"); response.append("HTTP/1.1 200 OK\r\n");
response.append("Connection: keep-alive\r\n"); response.append("Connection: keep-alive\r\n");
response.append("Content-Type: text/plain\r\n"); response.append("Content-Type: text/plain\r\n");
response.append("Content-Length: "); response.append("Content-Length: ");
response.append(NumberFormatter::format((int) body.size())); response.append(NumberFormatter::format((int) body.size()));
response.append("\r\n\r\n"); response.append("\r\n\r\n");
response.append("HTTP/1.1 200 OK\r\n"); response.append("HTTP/1.1 200 OK\r\n");
response.append("Connection: Keep-Alive\r\n"); response.append("Connection: Keep-Alive\r\n");
response.append("Content-Type: text/plain\r\n"); response.append("Content-Type: text/plain\r\n");
response.append("Content-Length: "); response.append("Content-Length: ");
response.append(NumberFormatter::format((int) body.size())); response.append(NumberFormatter::format((int) body.size()));
response.append("\r\n\r\n"); response.append("\r\n\r\n");
response.append(body); response.append(body);
body = LARGE_BODY; body = LARGE_BODY;
response.append("HTTP/1.1 200 OK\r\n"); response.append("HTTP/1.1 200 OK\r\n");
response.append("Connection: keep-alive\r\n"); response.append("Connection: keep-alive\r\n");
response.append("Content-Type: text/plain\r\n"); response.append("Content-Type: text/plain\r\n");
response.append("Transfer-Encoding: chunked\r\n\r\n"); response.append("Transfer-Encoding: chunked\r\n\r\n");
response.append(NumberFormatter::formatHex((unsigned) body.length())); response.append(NumberFormatter::formatHex((unsigned) body.length()));
response.append("\r\n"); response.append("\r\n");
response.append(body); response.append(body);
response.append("\r\n0\r\n\r\n"); response.append("\r\n0\r\n\r\n");
response.append("HTTP/1.1 200 OK\r\n"); response.append("HTTP/1.1 200 OK\r\n");
response.append("Connection: close\r\n"); response.append("Connection: close\r\n");
response.append("Content-Type: text/plain\r\n"); response.append("Content-Type: text/plain\r\n");
response.append("Content-Length: "); response.append("Content-Length: ");
response.append(NumberFormatter::format((int) body.size())); response.append(NumberFormatter::format((int) body.size()));
response.append("\r\n\r\n"); response.append("\r\n\r\n");
} }
else if (_lastRequest.substr(0, 13) == "GET /redirect") else if (_lastRequest.substr(0, 13) == "GET /redirect")
{ {
response.append("HTTP/1.0 302 Found\r\n"); response.append("HTTP/1.0 302 Found\r\n");
response.append("Location: /large\r\n"); response.append("Location: /large\r\n");
response.append("\r\n"); response.append("\r\n");
} }
else if (_lastRequest.substr(0, 13) == "GET /notfound") else if (_lastRequest.substr(0, 13) == "GET /notfound")
{ {
response.append("HTTP/1.0 404 Not Found\r\n"); response.append("HTTP/1.0 404 Not Found\r\n");
response.append("\r\n"); response.append("\r\n");
} }
else if (_lastRequest.substr(0, 5) == "GET /" || else if (_lastRequest.substr(0, 5) == "GET /" ||
_lastRequest.substr(0, 6) == "HEAD /") _lastRequest.substr(0, 6) == "HEAD /")
{ {
std::string body(SMALL_BODY); std::string body(SMALL_BODY);
response.append("HTTP/1.0 200 OK\r\n"); response.append("HTTP/1.0 200 OK\r\n");
response.append("Content-Type: text/plain\r\n"); response.append("Content-Type: text/plain\r\n");
response.append("Content-Length: "); response.append("Content-Length: ");
response.append(NumberFormatter::format((int) body.size())); response.append(NumberFormatter::format((int) body.size()));
response.append("\r\n"); response.append("\r\n");
response.append("Connection: Close\r\n"); response.append("Connection: Close\r\n");
response.append("\r\n"); response.append("\r\n");
if (_lastRequest.substr(0, 3) == "GET") if (_lastRequest.substr(0, 3) == "GET")
response.append(body); response.append(body);
} }
return response; return response;
} }

View File

@@ -1,81 +1,81 @@
// //
// HTTPSTestServer.h // HTTPSTestServer.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSTestServer.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/HTTPSTestServer.h#1 $
// //
// Definition of the HTTPSTestServer class. // Definition of the HTTPSTestServer class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef HTTPSTestServer_INCLUDED #ifndef HTTPSTestServer_INCLUDED
#define HTTPSTestServer_INCLUDED #define HTTPSTestServer_INCLUDED
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
#include "Poco/Net/SecureServerSocket.h" #include "Poco/Net/SecureServerSocket.h"
#include "Poco/Thread.h" #include "Poco/Thread.h"
#include "Poco/Event.h" #include "Poco/Event.h"
class HTTPSTestServer: public Poco::Runnable 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(); ~HTTPSTestServer();
/// Destroys the 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
/// listening on. /// listening on.
void run(); void run();
/// Does the work. /// Does the work.
const std::string& lastRequest() const; const std::string& lastRequest() const;
/// Returns the last request. /// Returns the last request.
static const std::string SMALL_BODY; static const std::string SMALL_BODY;
static const std::string LARGE_BODY; static const std::string LARGE_BODY;
protected: protected:
bool requestComplete() const; bool requestComplete() const;
std::string handleRequest() const; std::string handleRequest() const;
private: private:
Poco::Net::SecureServerSocket _socket; Poco::Net::SecureServerSocket _socket;
Poco::Thread _thread; Poco::Thread _thread;
Poco::Event _ready; Poco::Event _ready;
bool _stop; bool _stop;
std::string _lastRequest; std::string _lastRequest;
}; };
#endif // HTTPSTestServer_INCLUDED #endif // HTTPSTestServer_INCLUDED

View File

@@ -1,50 +1,50 @@
// //
// OpenSSLTestSuite.cpp // OpenSSLTestSuite.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/NetSSLTestSuite.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/NetSSLTestSuite.cpp#1 $
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "NetSSLTestSuite.h" #include "NetSSLTestSuite.h"
#include "HTTPSClientTestSuite.h" #include "HTTPSClientTestSuite.h"
#include "TCPServerTestSuite.h" #include "TCPServerTestSuite.h"
#include "HTTPSServerTestSuite.h" #include "HTTPSServerTestSuite.h"
CppUnit::Test* NetSSLTestSuite::suite() CppUnit::Test* NetSSLTestSuite::suite()
{ {
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("OpenSSLTestSuite"); CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("OpenSSLTestSuite");
pSuite->addTest(HTTPSClientTestSuite::suite()); pSuite->addTest(HTTPSClientTestSuite::suite());
pSuite->addTest(TCPServerTestSuite::suite()); pSuite->addTest(TCPServerTestSuite::suite());
pSuite->addTest(HTTPSServerTestSuite::suite()); pSuite->addTest(HTTPSServerTestSuite::suite());
return pSuite; return pSuite;
} }

View File

@@ -1,49 +1,49 @@
// //
// NetSSLTestSuite.h // NetSSLTestSuite.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/NetSSLTestSuite.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/NetSSLTestSuite.h#1 $
// //
// Definition of the NetSSLTestSuite class. // Definition of the NetSSLTestSuite class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef NetSSLTestSuite_INCLUDED #ifndef NetSSLTestSuite_INCLUDED
#define NetSSLTestSuite_INCLUDED #define NetSSLTestSuite_INCLUDED
#include "CppUnit/TestSuite.h" #include "CppUnit/TestSuite.h"
class NetSSLTestSuite class NetSSLTestSuite
{ {
public: public:
static CppUnit::Test* suite(); static CppUnit::Test* suite();
}; };
#endif // NetSSLTestSuite_INCLUDED #endif // NetSSLTestSuite_INCLUDED

View File

@@ -1,277 +1,277 @@
// //
// TCPServerTest.cpp // TCPServerTest.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/TCPServerTest.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/TCPServerTest.cpp#1 $
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "TCPServerTest.h" #include "TCPServerTest.h"
#include "CppUnit/TestCaller.h" #include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h" #include "CppUnit/TestSuite.h"
#include "Poco/Net/TCPServer.h" #include "Poco/Net/TCPServer.h"
#include "Poco/Net/TCPServerConnection.h" #include "Poco/Net/TCPServerConnection.h"
#include "Poco/Net/TCPServerConnectionFactory.h" #include "Poco/Net/TCPServerConnectionFactory.h"
#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/Thread.h" #include "Poco/Thread.h"
#include <iostream> #include <iostream>
using Poco::Net::TCPServer; using Poco::Net::TCPServer;
using Poco::Net::TCPServerConnection; using Poco::Net::TCPServerConnection;
using Poco::Net::TCPServerConnectionFactory; using Poco::Net::TCPServerConnectionFactory;
using Poco::Net::TCPServerConnectionFactoryImpl; using Poco::Net::TCPServerConnectionFactoryImpl;
using Poco::Net::TCPServerParams; using Poco::Net::TCPServerParams;
using Poco::Net::StreamSocket; 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::Thread; using Poco::Thread;
namespace namespace
{ {
class EchoConnection: public TCPServerConnection class EchoConnection: public TCPServerConnection
{ {
public: public:
EchoConnection(const StreamSocket& s): TCPServerConnection(s) EchoConnection(const StreamSocket& s): TCPServerConnection(s)
{ {
} }
void run() void run()
{ {
StreamSocket& ss = socket(); StreamSocket& ss = socket();
try try
{ {
char buffer[256]; char buffer[256];
int n = ss.receiveBytes(buffer, sizeof(buffer)); int n = ss.receiveBytes(buffer, sizeof(buffer));
while (n > 0) while (n > 0)
{ {
ss.sendBytes(buffer, n); ss.sendBytes(buffer, n);
n = ss.receiveBytes(buffer, sizeof(buffer)); n = ss.receiveBytes(buffer, sizeof(buffer));
} }
} }
catch (Poco::Exception& exc) catch (Poco::Exception& exc)
{ {
std::cerr << "EchoConnection: " << exc.displayText() << std::endl; std::cerr << "EchoConnection: " << exc.displayText() << std::endl;
} }
} }
}; };
} }
TCPServerTest::TCPServerTest(const std::string& name): CppUnit::TestCase(name) TCPServerTest::TCPServerTest(const std::string& name): CppUnit::TestCase(name)
{ {
} }
TCPServerTest::~TCPServerTest() TCPServerTest::~TCPServerTest()
{ {
} }
void TCPServerTest::testOneConnection() void TCPServerTest::testOneConnection()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
TCPServer srv(new TCPServerConnectionFactoryImpl<EchoConnection>(), svs); TCPServer srv(new TCPServerConnectionFactoryImpl<EchoConnection>(), svs);
srv.start(); srv.start();
assert (srv.currentConnections() == 0); assert (srv.currentConnections() == 0);
assert (srv.currentThreads() == 0); assert (srv.currentThreads() == 0);
assert (srv.queuedConnections() == 0); assert (srv.queuedConnections() == 0);
assert (srv.totalConnections() == 0); assert (srv.totalConnections() == 0);
SocketAddress sa("localhost", svs.address().port()); SocketAddress sa("localhost", svs.address().port());
SecureStreamSocket ss1(sa); SecureStreamSocket ss1(sa);
std::string data("hello, world"); std::string data("hello, world");
ss1.sendBytes(data.data(), (int) data.size()); ss1.sendBytes(data.data(), (int) data.size());
char buffer[256]; char buffer[256];
int n = ss1.receiveBytes(buffer, sizeof(buffer)); int n = ss1.receiveBytes(buffer, sizeof(buffer));
assert (n > 0); assert (n > 0);
assert (std::string(buffer, n) == data); assert (std::string(buffer, n) == data);
assert (srv.currentConnections() == 1); assert (srv.currentConnections() == 1);
assert (srv.currentThreads() == 1); assert (srv.currentThreads() == 1);
assert (srv.queuedConnections() == 0); assert (srv.queuedConnections() == 0);
assert (srv.totalConnections() == 1); assert (srv.totalConnections() == 1);
ss1.close(); ss1.close();
Thread::sleep(300); Thread::sleep(300);
assert (srv.currentConnections() == 0); assert (srv.currentConnections() == 0);
} }
void TCPServerTest::testTwoConnections() void TCPServerTest::testTwoConnections()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
TCPServer srv(new TCPServerConnectionFactoryImpl<EchoConnection>(), svs); TCPServer srv(new TCPServerConnectionFactoryImpl<EchoConnection>(), svs);
srv.start(); srv.start();
assert (srv.currentConnections() == 0); assert (srv.currentConnections() == 0);
assert (srv.currentThreads() == 0); assert (srv.currentThreads() == 0);
assert (srv.queuedConnections() == 0); assert (srv.queuedConnections() == 0);
assert (srv.totalConnections() == 0); assert (srv.totalConnections() == 0);
SocketAddress sa("localhost", svs.address().port()); SocketAddress sa("localhost", svs.address().port());
SecureStreamSocket ss1(sa); SecureStreamSocket ss1(sa);
SecureStreamSocket ss2(sa); SecureStreamSocket ss2(sa);
std::string data("hello, world"); std::string data("hello, world");
ss1.sendBytes(data.data(), (int) data.size()); ss1.sendBytes(data.data(), (int) data.size());
ss2.sendBytes(data.data(), (int) data.size()); ss2.sendBytes(data.data(), (int) data.size());
char buffer[256]; char buffer[256];
int n = ss1.receiveBytes(buffer, sizeof(buffer)); int n = ss1.receiveBytes(buffer, sizeof(buffer));
assert (n > 0); assert (n > 0);
assert (std::string(buffer, n) == data); assert (std::string(buffer, n) == data);
n = ss2.receiveBytes(buffer, sizeof(buffer)); n = ss2.receiveBytes(buffer, sizeof(buffer));
assert (n > 0); assert (n > 0);
assert (std::string(buffer, n) == data); assert (std::string(buffer, n) == data);
assert (srv.currentConnections() == 2); assert (srv.currentConnections() == 2);
assert (srv.currentThreads() == 2); assert (srv.currentThreads() == 2);
assert (srv.queuedConnections() == 0); assert (srv.queuedConnections() == 0);
assert (srv.totalConnections() == 2); assert (srv.totalConnections() == 2);
ss1.close(); ss1.close();
Thread::sleep(300); Thread::sleep(300);
assert (srv.currentConnections() == 1); assert (srv.currentConnections() == 1);
assert (srv.currentThreads() == 1); assert (srv.currentThreads() == 1);
assert (srv.queuedConnections() == 0); assert (srv.queuedConnections() == 0);
assert (srv.totalConnections() == 2); assert (srv.totalConnections() == 2);
ss2.close(); ss2.close();
Thread::sleep(300); Thread::sleep(300);
assert (srv.currentConnections() == 0); assert (srv.currentConnections() == 0);
} }
void TCPServerTest::testMultiConnections() void TCPServerTest::testMultiConnections()
{ {
SecureServerSocket svs(0); SecureServerSocket svs(0);
TCPServerParams* pParams = new TCPServerParams; TCPServerParams* pParams = new TCPServerParams;
pParams->setMaxThreads(4); pParams->setMaxThreads(4);
pParams->setMaxQueued(4); pParams->setMaxQueued(4);
pParams->setThreadIdleTime(100); pParams->setThreadIdleTime(100);
TCPServer srv(new TCPServerConnectionFactoryImpl<EchoConnection>(), svs, pParams); TCPServer srv(new TCPServerConnectionFactoryImpl<EchoConnection>(), svs, pParams);
srv.start(); srv.start();
assert (srv.currentConnections() == 0); assert (srv.currentConnections() == 0);
assert (srv.currentThreads() == 0); assert (srv.currentThreads() == 0);
assert (srv.queuedConnections() == 0); assert (srv.queuedConnections() == 0);
assert (srv.totalConnections() == 0); assert (srv.totalConnections() == 0);
SocketAddress sa("localhost", svs.address().port()); SocketAddress sa("localhost", svs.address().port());
SecureStreamSocket ss1(sa); SecureStreamSocket ss1(sa);
SecureStreamSocket ss2(sa); SecureStreamSocket ss2(sa);
SecureStreamSocket ss3(sa); SecureStreamSocket ss3(sa);
SecureStreamSocket ss4(sa); SecureStreamSocket ss4(sa);
std::string data("hello, world"); std::string data("hello, world");
ss1.sendBytes(data.data(), (int) data.size()); ss1.sendBytes(data.data(), (int) data.size());
ss2.sendBytes(data.data(), (int) data.size()); ss2.sendBytes(data.data(), (int) data.size());
ss3.sendBytes(data.data(), (int) data.size()); ss3.sendBytes(data.data(), (int) data.size());
ss4.sendBytes(data.data(), (int) data.size()); ss4.sendBytes(data.data(), (int) data.size());
char buffer[256]; char buffer[256];
int n = ss1.receiveBytes(buffer, sizeof(buffer)); int n = ss1.receiveBytes(buffer, sizeof(buffer));
assert (n > 0); assert (n > 0);
assert (std::string(buffer, n) == data); assert (std::string(buffer, n) == data);
n = ss2.receiveBytes(buffer, sizeof(buffer)); n = ss2.receiveBytes(buffer, sizeof(buffer));
assert (n > 0); assert (n > 0);
assert (std::string(buffer, n) == data); assert (std::string(buffer, n) == data);
n = ss3.receiveBytes(buffer, sizeof(buffer)); n = ss3.receiveBytes(buffer, sizeof(buffer));
assert (n > 0); assert (n > 0);
assert (std::string(buffer, n) == data); assert (std::string(buffer, n) == data);
n = ss4.receiveBytes(buffer, sizeof(buffer)); n = ss4.receiveBytes(buffer, sizeof(buffer));
assert (n > 0); assert (n > 0);
assert (std::string(buffer, n) == data); assert (std::string(buffer, n) == data);
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(sa);
Thread::sleep(200); Thread::sleep(200);
assert (srv.queuedConnections() == 1); assert (srv.queuedConnections() == 1);
SecureStreamSocket ss6(sa); SecureStreamSocket ss6(sa);
Thread::sleep(200); Thread::sleep(200);
assert (srv.queuedConnections() == 2); assert (srv.queuedConnections() == 2);
ss1.close(); ss1.close();
Thread::sleep(300); Thread::sleep(300);
assert (srv.currentConnections() == 4); assert (srv.currentConnections() == 4);
assert (srv.currentThreads() == 4); assert (srv.currentThreads() == 4);
assert (srv.queuedConnections() == 1); assert (srv.queuedConnections() == 1);
assert (srv.totalConnections() == 5); assert (srv.totalConnections() == 5);
ss2.close(); ss2.close();
Thread::sleep(300); Thread::sleep(300);
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() == 6); assert (srv.totalConnections() == 6);
ss3.close(); ss3.close();
Thread::sleep(300); Thread::sleep(300);
assert (srv.currentConnections() == 3); assert (srv.currentConnections() == 3);
assert (srv.currentThreads() == 3); assert (srv.currentThreads() == 3);
assert (srv.queuedConnections() == 0); assert (srv.queuedConnections() == 0);
assert (srv.totalConnections() == 6); assert (srv.totalConnections() == 6);
ss4.close(); ss4.close();
Thread::sleep(300); Thread::sleep(300);
assert (srv.currentConnections() == 2); assert (srv.currentConnections() == 2);
assert (srv.currentThreads() == 2); assert (srv.currentThreads() == 2);
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::setUp() void TCPServerTest::setUp()
{ {
} }
void TCPServerTest::tearDown() void TCPServerTest::tearDown()
{ {
} }
CppUnit::Test* TCPServerTest::suite() 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);
return pSuite; return pSuite;
} }

View File

@@ -1,62 +1,62 @@
// //
// TCPServerTest.h // TCPServerTest.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/TCPServerTest.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/TCPServerTest.h#1 $
// //
// Definition of the TCPServerTest class. // Definition of the TCPServerTest class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef TCPServerTest_INCLUDED #ifndef TCPServerTest_INCLUDED
#define TCPServerTest_INCLUDED #define TCPServerTest_INCLUDED
#include "Poco/Net/Net.h" #include "Poco/Net/Net.h"
#include "CppUnit/TestCase.h" #include "CppUnit/TestCase.h"
class TCPServerTest: public CppUnit::TestCase class TCPServerTest: public CppUnit::TestCase
{ {
public: 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 setUp(); void setUp();
void tearDown(); void tearDown();
static CppUnit::Test* suite(); static CppUnit::Test* suite();
private: private:
}; };
#endif // TCPServerTest_INCLUDED #endif // TCPServerTest_INCLUDED

View File

@@ -1,44 +1,44 @@
// //
// TCPServerTestSuite.cpp // TCPServerTestSuite.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/TCPServerTestSuite.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/TCPServerTestSuite.cpp#1 $
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "TCPServerTestSuite.h" #include "TCPServerTestSuite.h"
#include "TCPServerTest.h" #include "TCPServerTest.h"
CppUnit::Test* TCPServerTestSuite::suite() CppUnit::Test* TCPServerTestSuite::suite()
{ {
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TCPServerTestSuite"); CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("TCPServerTestSuite");
pSuite->addTest(TCPServerTest::suite()); pSuite->addTest(TCPServerTest::suite());
return pSuite; return pSuite;
} }

View File

@@ -1,49 +1,49 @@
// //
// TCPServerTestSuite.h // TCPServerTestSuite.h
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/TCPServerTestSuite.h#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/TCPServerTestSuite.h#1 $
// //
// Definition of the TCPServerTestSuite class. // Definition of the TCPServerTestSuite class.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#ifndef TCPServerTestSuite_INCLUDED #ifndef TCPServerTestSuite_INCLUDED
#define TCPServerTestSuite_INCLUDED #define TCPServerTestSuite_INCLUDED
#include "CppUnit/TestSuite.h" #include "CppUnit/TestSuite.h"
class TCPServerTestSuite class TCPServerTestSuite
{ {
public: public:
static CppUnit::Test* suite(); static CppUnit::Test* suite();
}; };
#endif // TCPServerTestSuite_INCLUDED #endif // TCPServerTestSuite_INCLUDED

View File

@@ -1,86 +1,86 @@
// //
// WinDriver.cpp // WinDriver.cpp
// //
// $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/WinDriver.cpp#1 $ // $Id: //poco/1.3/NetSSL_OpenSSL/testsuite/src/WinDriver.cpp#1 $
// //
// Windows test driver for Poco OpenSSL. // Windows test driver for Poco OpenSSL.
// //
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // Copyright (c) 2006, 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
// obtaining a copy of the software and accompanying documentation covered by // obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute, // this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the // 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 // Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following: // do so, all subject to the following:
// //
// The copyright notices in the Software and this entire statement, including // The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer, // 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 // 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 // all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by // works are solely in the form of machine-executable object code generated by
// a source language processor. // a source language processor.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // 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 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// //
#include "WinTestRunner/WinTestRunner.h" #include "WinTestRunner/WinTestRunner.h"
#include "NetSSLTestSuite.h" #include "NetSSLTestSuite.h"
#include "Poco/Util/Application.h" #include "Poco/Util/Application.h"
#include "Poco/Net/HTTPStreamFactory.h" #include "Poco/Net/HTTPStreamFactory.h"
#include "Poco/Net/HTTPSStreamFactory.h" #include "Poco/Net/HTTPSStreamFactory.h"
class NetSSLApp: public Poco::Util::Application class NetSSLApp: public Poco::Util::Application
{ {
public: public:
NetSSLApp() NetSSLApp()
{ {
} }
~NetSSLApp() ~NetSSLApp()
{ {
} }
protected: protected:
void initialize(Application& self) void initialize(Application& self)
{ {
loadConfiguration(); // load default configuration files, if present loadConfiguration(); // load default configuration files, if present
Application::initialize(self); Application::initialize(self);
} }
}; };
class TestDriver: public CppUnit::WinTestRunnerApp class TestDriver: public CppUnit::WinTestRunnerApp
{ {
void TestMain() void TestMain()
{ {
CppUnit::WinTestRunner runner; CppUnit::WinTestRunner runner;
Poco::Net::HTTPStreamFactory::registerFactory(); Poco::Net::HTTPStreamFactory::registerFactory();
Poco::Net::HTTPSStreamFactory::registerFactory(); Poco::Net::HTTPSStreamFactory::registerFactory();
NetSSLApp app; NetSSLApp app;
std::string argv("OpenSSLTest"); std::string argv("OpenSSLTest");
const char* pArgv = argv.c_str(); const char* pArgv = argv.c_str();
try try
{ {
app.init(1, (char**)&pArgv); 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.addTest(NetSSLTestSuite::suite());
runner.run(); runner.run();
} }
}; };
static TestDriver theDriver; static TestDriver theDriver;

View File

@@ -1,42 +1,42 @@
<AppConfig> <AppConfig>
<openSSL> <openSSL>
<server> <server>
<privateKeyFile>${application.configDir}any.pem</privateKeyFile> <privateKeyFile>${application.configDir}any.pem</privateKeyFile>
<caConfig>${application.configDir}rootcert.pem</caConfig> <caConfig>${application.configDir}rootcert.pem</caConfig>
<verificationMode>none</verificationMode> <verificationMode>none</verificationMode>
<verificationDepth>9</verificationDepth> <verificationDepth>9</verificationDepth>
<loadDefaultCAFile>true</loadDefaultCAFile> <loadDefaultCAFile>true</loadDefaultCAFile>
<cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList> <cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList>
<privateKeyPassphraseHandler> <privateKeyPassphraseHandler>
<name>KeyFileHandler</name> <name>KeyFileHandler</name>
<options> <options>
<password>test</password> <password>test</password>
</options> </options>
</privateKeyPassphraseHandler> </privateKeyPassphraseHandler>
<invalidCertificateHandler> <invalidCertificateHandler>
<name>AcceptCertificateHandler</name> <name>AcceptCertificateHandler</name>
<options> <options>
</options> </options>
</invalidCertificateHandler> </invalidCertificateHandler>
</server> </server>
<client> <client>
<privateKeyFile>${application.configDir}any.pem</privateKeyFile> <privateKeyFile>${application.configDir}any.pem</privateKeyFile>
<caConfig>${application.configDir}rootcert.pem</caConfig> <caConfig>${application.configDir}rootcert.pem</caConfig>
<verificationMode>relaxed</verificationMode> <verificationMode>relaxed</verificationMode>
<verificationDepth>9</verificationDepth> <verificationDepth>9</verificationDepth>
<loadDefaultCAFile>true</loadDefaultCAFile> <loadDefaultCAFile>true</loadDefaultCAFile>
<cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList> <cypherList>ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH</cypherList>
<privateKeyPassphraseHandler> <privateKeyPassphraseHandler>
<name>KeyFileHandler</name> <name>KeyFileHandler</name>
<options> <options>
<password>test</password> <password>test</password>
</options> </options>
</privateKeyPassphraseHandler> </privateKeyPassphraseHandler>
<invalidCertificateHandler> <invalidCertificateHandler>
<name>AcceptCertificateHandler</name> <name>AcceptCertificateHandler</name>
<options> <options>
</options> </options>
</invalidCertificateHandler> </invalidCertificateHandler>
</client> </client>
</openSSL> </openSSL>
</AppConfig> </AppConfig>