2016-06-19 39 views
0
から

から呼び出す方法こんにちは皆https/sslを有効にしたsoap webserviceにアクセスしようとしています。しかし、私はこのエラーを取得しています:SSLを有効にするsoap webserviceをVB.netまたはC#

System.Net.WebExceptionは、要求が中断されました未処理

た:SSL/TLSのセキュリティで保護されたチャネルを作成できませんでした。

以下は、私が電話をするために使用しているコードです。

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 
    Dim url As String = "https://10.31.171.199:8443/emc-dfs/services/core/ObjectService?WSDL" 
    System.Net.ServicePointManager.ServerCertificateValidationCallback = New System.Net.Security.RemoteCertificateValidationCallback(AddressOf ValidateRemoteCertificate) 
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls Or SecurityProtocolType.Ssl3 
    Dim responsestring As String = "" 
    Dim myReq As HttpWebRequest = WebRequest.Create(url) 
    Dim proxy As IWebProxy = CType(myReq.Proxy, IWebProxy) 
    Dim proxyaddress As String 
    Dim myProxy As New WebProxy() 
    Dim response As String 


    myReq.AllowWriteStreamBuffering = False 
    myReq.Method = "GET" 
    myReq.ContentType = "application/soap+xml; charset=utf-8" 
    myReq.PreAuthenticate = True 
    proxyaddress = proxy.GetProxy(myReq.RequestUri).ToString 

    Dim newUri As New Uri(proxyaddress) 
    myProxy.Address = newUri 
    Dim myResponse As HttpWebResponse = myReq.GetResponse 

    Dim responsedata As Stream = myResponse.GetResponseStream 
    Dim responsereader As New StreamReader(responsedata) 

    response = responsereader.ReadToEnd 
End Sub 

私は "HttpWebResponseの= myReq.GetResponseとして薄暗いmyResponse" ライン上でこのエラーを取得しています。

私はこの問題をどのように助けてください、どうすればこのサービスを呼び出すことができますか? SSL石鹸サービスの実用的なサンプルコードを手伝ってください。

ありがとうございました。

+0

使用シオマネキ。 IEブラウザを使用して、アプリケーションの結果を同様の結果と比較することができます。 IEとアプリケーションのHttpヘッダーを比較してください。 – jdweng

答えて

0

サーバのTLSがの場合、バージョンはではない可能性がありますか?試してみてください:

権要求メソッドを呼び出す前に、すなわち、チェック作品をバイパスする証明書検証デリゲートを設定するかどうかを確認、というバーリング
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls Or SecurityProtocolType.Ssl3 Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls12 

:HTMLをキャプチャする ServicePointManager.ServerCertificateValidationCallback = Function() Return True

+0

TLSバージョンもサーバー上で1.0です。コードで証明書の検証をバイパスしましたが、依然として動作しません。 – Sushil

+0

これは、外部サービス(パブリック)への接続を確立しようとしている内部サービスですか? @ jdwengがFiddler/IEで提案したことを試しましたか? – ffa

+0

また、承認のためにSOAPエンベロープヘッダーに必要な資格情報が不足している可能性がありますか([https://community.emc.com/message/536141#536141]? – ffa

関連する問題