簡體   English   中英

從具有無效SSL證書的WSDL生成服務代理時發出問題

[英]Issue while generating a service proxy from WSDL with invalid SSL Certificate

我正在嘗試編寫一個訪問Web服務的小應用程序,但Web服務具有無效的SSL證書。 我無法控制這個事實,因為它是由第三方管理的。

我嘗試通過IE訪問該網站(作為管理員和我自己的用戶)並安裝證書,但它似乎沒有做太多,因為下次我瀏覽它時,我得到相同的錯誤。

當我運行svcutil時,我得到以下輸出:

C:\Personal>svcutil.exe https://b2b:9443/LiveFeed.svc?wsdl
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
Copyright (c) Microsoft Corporation.  All rights reserved.

Attempting to download metadata from 'https://b2b:9443/LiveFeed.svc?wsdl' using
WS-Metadata Exchange or DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
Copyright (c) Microsoft Corporation.  All rights reserved.

Error: Cannot obtain Metadata from https://b2b:9443/LiveFeed.svc?wsdl

If this is a Windows (R) Communication Foundation service to which you have acce
ss, please check that you have enabled metadata publishing at the specified addr
ess.  For help enabling metadata publishing, please refer to the MSDN documentat
ion at http://go.microsoft.com/fwlink/?LinkId=65455.


WS-Metadata Exchange Error
    URI: https://b2b:9443/LiveFeed.svc?wsdl

    Metadata contains a reference that cannot be resolved: 'https://b2b:9443/Liv
eFeed.svc?wsdl'.

    Could not establish trust relationship for the SSL/TLS secure channel with a
uthority 'b2b:9443'.

    The underlying connection was closed: Could not establish trust relationship
 for the SSL/TLS secure channel.

    The remote certificate is invalid according to the validation procedure.


HTTP GET Error
    URI: https://b2b:9443/LiveFeed.svc?wsdl

    There was an error downloading 'https://b2b:9443/LiveFeed.svc?wsdl'.

    The underlying connection was closed: Could not establish trust relationship
 for the SSL/TLS secure channel.

    The remote certificate is invalid according to the validation procedure.

If you would like more help, type "svcutil /?"

我知道問題與證書無效有關,但我似乎無法使證書受信任。 我該怎么做呢?

到目前為止我所做的是單擊錯誤,查看證書並安裝它。 我在證書商店試過這個,Windows選擇它自己,在個人和可信任的商店,這沒有任何區別。

即使我設法解決這個問題,我擔心當我在客戶PC上安裝應用程序時,我會遇到問題,因為我們在兩個不同的國家/地區。

任何幫助,將不勝感激。

它可能與為證書安裝根CA證書一樣簡單。

這個問題的答案可能對您有所幫助: .net WebService,繞過ssl驗證!

  try this before calling the service..

  ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(
            delegate
            {
                return true;
            });

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM