简体   繁体   English

使用HTTPS和客户端证书身份验证连接到IIS

[英]Connect to a IIS with HTTPS and client-certificate authentication

I really struggle with the following problem. 我真的遇到以下问题。 Must connect to a IIS with activated client-certificate-authentication and over https. 必须通过激活的客户端证书身份验证并通过https连接到IIS。

As far I think it is a pretty much MS story and therefore its a bit tough with other than MS-technologie 到目前为止,我认为这是一个有关MS的故事,因此,除了MS技术之外,它还有一点困难

If I do in .net C# all is fine. 如果我在.net C#中进行,一切都很好。

HttpWebRequest req = (HttpWebRequest( WebRequest.Create ("https://abc.abc");
req.ClientCertificates.Add (new X509Certificate2 ("cert.pfx", "pwd"));

But I did not found any glue in doing it in Perl or Java. 但是我在Perl或Java中没有发现任何胶合剂。 Just found username/passwort-authentication and SSL-certificates but I think thats something else here. 刚刚找到了用户名/密码验证和SSL证书,但我认为这里还有其他内容。

Here I get a HTTP 403. 在这里,我得到一个HTTP 403。

Tried a lot of code (from axis to java ssl-context) but nothing was working properly. 尝试了很多代码(从axis到java ssl-context),但没有任何工作正常。

But there must be a way because I can do it with a browser as well (add the certificate in the browsers store and it works). 但是必须有一种方法,因为我也可以使用浏览器来做到这一点(将证书添加到浏览器存储中并且可以使用)。

Any help? 有什么帮助吗? Thanks! 谢谢!

Chris 克里斯

The problem was the key. 问题是关键。 Perls LWP::Useragent needs also a key-file. Perls LWP :: Useragent还需要一个密钥文件。 But I need to add it not all within a PFX but all extra. 但是我不需要将其全部添加到PFX中,而是全部添加。 If I did all was fine. 如果我做的一切都很好。 Thanks anyway! 不管怎么说,还是要谢谢你!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM