SAVON 是否支持客户端证书认证

编程入门 行业动态 更新时间:2024-10-06 22:27:44
本文介绍了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 => "..", :endpoint => '...:557/x/b/c', #:wsdl => '...: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 是否支持客户端证书认证

本文发布于:2023-11-26 09:34:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1633581.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   证书   SAVON

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!