相关疑难解决方法(0)

使用Http代理v/s https代理的优缺点?

JVM允许代理属性http.proxyHost和http.proxyPort用于指定HTTP代理服务器,https.proxyHost和https.proxyPort用于指定HTTPS代理服务器.

我想知道使用HTTPS代理服务器与HTTP代理服务器相比是否有任何优势?

通过HTTPS代理访问https url比从HTTP代理访问它更麻烦吗?

https proxy http

10
推荐指数
4
解决办法
2万
查看次数

通过代理服务器访问HTTPS站点

我正在添加代码以使用代理服务器访问Internet.从正常(HTTP)位置请求文件时,代码工作正常,但在访问安全位置(HTTPS)时不起作用.

这是可以正常工作的代码:

URL = "http://UnSecureSite.net/file.xml"
Dim wr As HttpWebRequest = CType(WebRequest.Create(URL), HttpWebRequest)
Dim proxy As System.Net.IWebProxy
proxy = WebRequest.GetSystemWebProxy
wr.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)

// (more work here)
Run Code Online (Sandbox Code Playgroud)

一旦我将URL更改为HTTPS,我就会将407返回给我.

有人有主意吗?

URL = "https://SecureSite.net/file.xml"
Dim wr As HttpWebRequest = CType(WebRequest.Create(URL), HttpWebRequest)
Dim proxy As System.Net.IWebProxy
proxy = WebRequest.GetSystemWebProxy
wr.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim myCache As New CredentialCache()
myCache.Add(New Uri("https://SecureSite.net"), "Basic", New NetworkCredential(UserName, Password))
wr.Credentials = myCache
Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)

// (more work here)
Run Code Online (Sandbox Code Playgroud)

vb.net https proxy

1
推荐指数
1
解决办法
5257
查看次数

标签 统计

https ×2

proxy ×2

http ×1

vb.net ×1