soap-tls-0.1.1.4/src/0000755000000000000000000000000013235062213012367 5ustar0000000000000000soap-tls-0.1.1.4/src/Network/0000755000000000000000000000000013235062213014020 5ustar0000000000000000soap-tls-0.1.1.4/src/Network/SOAP/0000755000000000000000000000000013235062213014562 5ustar0000000000000000soap-tls-0.1.1.4/src/Network/SOAP/Transport/0000755000000000000000000000000013235062213016556 5ustar0000000000000000soap-tls-0.1.1.4/src/Network/SOAP/Transport/HTTP/0000755000000000000000000000000013235062213017335 5ustar0000000000000000soap-tls-0.1.1.4/src/Network/SOAP/Transport/HTTP/TLS.hs0000644000000000000000000000376413252734434020357 0ustar0000000000000000-- | SSL-enabled http transport with support for https requests and client certificates. module Network.SOAP.Transport.HTTP.TLS ( confTransport , makeSettings -- * Certificate validation , ServerCertCallback, validateDefault ) where import Network.HTTP.Client (ManagerSettings) import Network.SOAP.Transport (Transport) import Network.SOAP.Transport.HTTP (confTransportWith) import Network.HTTP.Client.TLS import Network.TLS import Data.X509 import Data.X509.CertificateStore import Data.X509.Validation import Network.Connection (TLSSettings(..)) import Data.Text (Text) import Data.Default (def) import qualified Data.Configurator as Conf import Data.Configurator.Types (Config) type ServerCertCallback = CertificateStore -> ValidationCache -> ServiceID -> CertificateChain -> IO [FailedReason] -- | Initialize a SOAP HTTP transport with HTTPS support using tls. confTransport :: Text -- ^ Section name containing transport settings. -> Config -> ServerCertCallback -> IO Transport confTransport section conf onSC = do cert <- Conf.lookup conf (section `mappend` ".client_cert") key <- Conf.lookup conf (section `mappend` ".client_key") settings <- makeSettings cert key onSC confTransportWith settings section conf id id makeSettings :: Maybe FilePath -> Maybe FilePath -> ServerCertCallback -> IO ManagerSettings makeSettings (Just certFile) (Just keyFile) onSC = do creds <- either error Just `fmap` credentialLoadX509 certFile keyFile let onCR _ = return creds let hooks = def { onCertificateRequest = onCR , onServerCertificate = onSC } let clientParams = (defaultParamsClient "" "") { clientHooks = hooks } return $! mkManagerSettings (TLSSettings clientParams) Nothing makeSettings _ _ _ = return tlsManagerSettings soap-tls-0.1.1.4/LICENSE0000644000000000000000000000206513235062213012610 0ustar0000000000000000Copyright (c) 2013 Alexander Bondarenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. soap-tls-0.1.1.4/Setup.hs0000644000000000000000000000005613235062213013235 0ustar0000000000000000import Distribution.Simple main = defaultMain soap-tls-0.1.1.4/soap-tls.cabal0000644000000000000000000000274313252743634014350 0ustar0000000000000000name: soap-tls version: 0.1.1.4 synopsis: TLS-enabled SOAP transport (using tls package) description: TLS-enabled SOAP transport (using tls package) . > main = do > -- Initial one-time preparations. > settings <- makeSettings (Just "client.crt") (Just "client.key") validateDefault > transport <- initTransportWith settings "http://example.com/soap/endpoint" id (iconv "cp-1251") > > -- the rest is the same as before... homepage: https://bitbucket.org/dpwiz/haskell-soap license: MIT license-file: LICENSE author: Alexander Bondarenko maintainer: aenor.realm@gmail.com -- copyright: category: Web build-type: Simple cabal-version: >=1.10 extra-source-files: changelog library ghc-options: -Wall exposed-modules: Network.SOAP.Transport.HTTP.TLS build-depends: base >= 4.8 && <5 , soap >= 0.2.2 && < 0.3 , configurator >= 0.3 && < 1.0 , connection >= 0.2.5 && < 0.3 , data-default >= 0.5.3 && < 1.0 , http-client >= 0.2 && < 1.0 , http-client-tls >= 0.2.4 && < 0.4 , text >= 1.2.2.1 && < 1.3 , tls >= 1.3.8 && < 2.0 , x509 >= 1.6.3 && < 2.0 , x509-store >= 1.6.1 && < 2.0 , x509-validation >= 1.6.3 && < 2.0 hs-source-dirs: src default-language: Haskell2010 default-extensions: OverloadedStrings soap-tls-0.1.1.4/changelog0000644000000000000000000000045613252735004013463 0ustar00000000000000000.1.1.4: * Remove redundant with base-4.11 monoid import. 0.1.1.3: * Drop upper bounds entirely. 0.1.1.1: * Raise http-client upper boundary. 0.1.1: + Server certificate validator can be specified for confTransport. * Re-export default validator from X509. 0.1: + Initial version.