SAVON 是否支持客户端证书认证 [英] Does SAVON support client side certificates authentication

查看:58
本文介绍了SAVON 是否支持客户端证书认证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在评估 savon 以使用网络服务...但我找不到任何信息,如果我可以使用 SSL 客户端证书对提供 SOAP 网络服务的服务器进行身份验证.我阅读了文档,但没有找到任何相关信息.

I'm evaluating savon for consuming webservices... but I dont find any information if I can use a SSL client side certificate to authenticate against the server that provides the SOAP webservices. I read the documentation but didn't find anything about it.

有谁知道SAVON是否支持客户端证书认证?

Does anyone know if SAVON supports client side certificate authentication?

问候假

推荐答案

Savon 的最新稳定版本(目前为 2.2.0)通过全局选项支持 SSL 客户端证书.请参阅文档中的 SSL 部分.

the latest stable version of Savon (2.2.0 at this moment) supports SSL client certificates via global options. Please refer to the SSL section in the documentation.

这里是一些示例代码,假设 httpclient 与 httpi 一起使用:

Here is some example code, assuming httpclient is used with httpi:

savonConfig = {
    :namespace => "http://...com",
    :endpoint => 'https://...:557/x/b/c',
    #:wsdl => 'https://...:557/x/b/c?wsdl',
    :log_level => :debug,
    :log => true,
    :ssl_verify_mode => :none,
    :ssl_cert_file => 'publicCert.pem',
    :ssl_cert_key_file => 'privateKey.pem',
    :ssl_cert_key_password => '1234',
    :open_timeout => 600,
    :read_timeout => 600
}

client = Savon.client savonConfig

soapBody = {
...
}


calcResponse = client.call(:charge, :message => soapBody)

如果您有 pfx 证书/密钥文件,则直接使用它可能会遇到问题-因此您可能希望将它们拆分为单独的文件-有关信息,请参阅此页面:从 PKCS12 文件中提取公钥/私钥以备后用在 SSH-PK-身份验证中

If you have a pfx certificate/key file, you may have problems using it directly - so you might want to split them out into separate files - see this page for info: Extract public/private key from PKCS12 file for later use in SSH-PK-Authentification

希望有帮助!
丹尼尔

Hope that helps!
Daniel

这篇关于SAVON 是否支持客户端证书认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆