How to use HTTP GET request in C# with SSL? (protocol violation)

后端 未结 3 1826
走了就别回头了
走了就别回头了 2020-12-13 22:55

I am currently trying to get a response from a server that is using SSL in C#. I have the code to do this in Java, but it looks like they do not translate 1:1.

I

3条回答
  •  北海茫月
    2020-12-13 23:48

    Just an idea, but have you tried it with a final "/"? Also - you might find this approach easier:

    string s;
    using(WebClient client = new WebClient()) {
        client.UseDefaultCredentials = true;
        s = client.DownloadString("https://" + sslServerHost + ":"
           + sslServerPort + "/");
    }
    

提交回复
热议问题