avatar
HTTP GET over SSL in C## DotNet - 窗口里的风景
e*e
1
This is driving me nuts!! Anyone, please help...
I would like to send an HTTP GET request to a server over SSL and I am using
System.Net.HttpWebRequest to do so. I have the valid certificate installed to
the Current User. That's for sure because I am able to access the same
resource using IE. But my code isn't working. Everytime it receives a
WebException, whose status is ConnectFailure, which means "The remote service
point could not be contacted at the transport level.", also whose message is
avatar
k*i
2
Dont work too hard and wish you all a Merry Christmas




【在 e****e 的大作中提到】
: This is driving me nuts!! Anyone, please help...
: I would like to send an HTTP GET request to a server over SSL and I am using
: System.Net.HttpWebRequest to do so. I have the valid certificate installed to
: the Current User. That's for sure because I am able to access the same
: resource using IE. But my code isn't working. Everytime it receives a
: WebException, whose status is ConnectFailure, which means "The remote service
: point could not be contacted at the transport level.", also whose message is

avatar
e*e
3
hehe :)
你给得如何设定empty proxy神奇的解决了我的问题,谢谢谢谢
by the way, 前面说得loading cert是optional的,只对client authentication有必要

你一定是知道得啦,写出来为了后来者:P。从server处获得的cert必须首先安装在受信任
德certificates store里面,否则不工作。

【在 k****i 的大作中提到】
: Dont work too hard and wish you all a Merry Christmas
:
: 要
: 任

avatar
k*i
4
Feel better to use c# rather than unmanaged c++ now?

")

【在 e****e 的大作中提到】
: hehe :)
: 你给得如何设定empty proxy神奇的解决了我的问题,谢谢谢谢
: by the way, 前面说得loading cert是optional的,只对client authentication有必要
: ,
: 你一定是知道得啦,写出来为了后来者:P。从server处获得的cert必须首先安装在受信任
: 德certificates store里面,否则不工作。

avatar
e*e
5
Thanx. will try it tomorrow.
BTW, do you know much about the certificates?
If I have imported a certificate to the Current User Personal store,
is there anything else I need to do in order to utilize this cert
when accessing via HTTPS?

【在 k****i 的大作中提到】
: Feel better to use c# rather than unmanaged c++ now?
:
: ")

avatar
e*e
6
hehe :)
你给得如何设定empty proxy神奇的解决了我的问题,谢谢谢谢
by the way, 前面说得loading cert是optional的,只对client authentication有必要

你一定是知道得啦,写出来为了后来者:P。从server处获得的cert必须首先安装在受信任
德certificates store里面,否则不工作。

【在 k****i 的大作中提到】
: Feel better to use c# rather than unmanaged c++ now?
:
: ")

avatar
k*i
7
set it to GlobalProxySelection.GetEmptyWebProxy()

【在 e****e 的大作中提到】
: hehe :)
: 你给得如何设定empty proxy神奇的解决了我的问题,谢谢谢谢
: by the way, 前面说得loading cert是optional的,只对client authentication有必要
: ,
: 你一定是知道得啦,写出来为了后来者:P。从server处获得的cert必须首先安装在受信任
: 德certificates store里面,否则不工作。

avatar
e*e
8
hey, thanx for replying.
no i didn't
when debugging, i found out that the Proxy proterty of the instance
of HttpWebRequest is always our proxy server, no matter how I set
it or disabled it at IE. Then I tried to set this property with
a blank proxy:
req.Proxy = new WebProxy();
but it didn't help.
Now I am at home, am testing with the same server, it's an different
exception message I got. Instead of ConnectFailure, it's TrustFailure.
So I am sure now it's about the network settings I had at offi

【在 k****i 的大作中提到】
: set it to GlobalProxySelection.GetEmptyWebProxy()
avatar
k*i
9
Dont work too hard and wish you all a Merry Christmas




【在 e****e 的大作中提到】
: hehe :)
: 你给得如何设定empty proxy神奇的解决了我的问题,谢谢谢谢
: by the way, 前面说得loading cert是optional的,只对client authentication有必要
: ,
: 你一定是知道得啦,写出来为了后来者:P。从server处获得的cert必须首先安装在受信任
: 德certificates store里面,否则不工作。

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。