简体   繁体   English

从.net客户端获取有关WCF ssl证书的到期日期/详细信息

[英]Obtain expiration date / details about a WCF ssl certificate from .net client

From my .net client code, is there a way to obtain details about an SSL certificate being used by a WCF service? 从我的.net客户端代码中,是否可以获取有关WCF服务正在使用的SSL证书的详细信息? Assuming I can already connect successfully over SSL to the service. 假设我已经可以通过SSL成功连接到该服务。

I am hoping to report the expiration date of the server certificate on a dashboard. 我希望在仪表板上报告服务器证书的到期日期。 If the certificate has been updated / renewed since the last time the client communicated with the service, I'm trying to detect that as well. 如果自从上一次客户端与服务进行通信以来,证书已被更新/续订,那么我也将尝试检测到该证书。

Let's also assume the server cert is a real public cert from godaddy etc. ie the cert would not have been explicitly imported into the client store already. 我们还假设服务器证书是Godaddy等提供的真实公共证书,即该证书尚未显式导入到客户端存储中。

Any thoughts? 有什么想法吗? I was thinking I might find somewhere in System.ServiceModel.ClientBase that I could find this after opening a connection but haven't found anything yet. 我以为我可能在System.ServiceModel.ClientBase中找到某个地方,可以在打开连接后找到它,但尚未找到任何东西。

Thanks! 谢谢!

Easiest way would probably be to just implement a certificate validation callback on the client so that you can have a chance to look at the SSL certificate provided by the server before it is trusted by the client: 最简单的方法可能是仅在客户端上实现证书验证回调,以便您有机会在客户端信任之前查看服务器提供的SSL证书:

http://msdn.microsoft.com/en-us/library/aa702579(v=vs.110).aspx http://msdn.microsoft.com/zh-CN/library/aa702579(v=vs.110).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 获取ssl证书信息 - .net - obtain ssl certificate information - .net WCF SSL客户端证书错误 - WCF SSL Client certificate error C#从ServerCertificateValidationCallback获取SMTP服务器的SSL证书到期日期作为返回值 - C# Get SSL-Certificate expiration date of SMTP-Server as return value from ServerCertificateValidationCallback 客户端上的WCF服务-SSL证书 - WCF Service on Client Side - SSL Certificate 涉及来自客户端笔记本电脑的带有 SSL 证书的 SharePoint WCF 服务失败 - To involve SharePoint WCF Service with SSL-Certificate from Client laptop failed Rest Client C#的Web.config中的SSl证书详细信息 - SSl certificate details in Web.config of Rest Client C# .NET将SSL证书添加到SOAP客户端请求 - .NET add SSL certificate to SOAP client request 如何从客户端应用程序获取运行Web服务的服务器的SSL证书? - C#.NET - How to get the SSL certificate of a server running a web service from the client app? - C# .NET wcf服务服务器和客户端证书与SSl证书不同时的安全异常 - Security exception when wcf service server and client certificate is different than SSl certificate WCF客户端证书身份验证,服务“ SslRequireCert”的SSL设置与IIS“ Ssl,SslNegotiateCert”的SSL设置不匹配 - WCF Client Certificate Authentication, The SSL settings for the service 'SslRequireCert' does not match those of the IIS 'Ssl, SslNegotiateCert'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM