2016-07-25 7 views
1

これは前に尋ねられましたが、私は完全に立ち往生しています。これまでのところ、他の質問に記載されているものはありません。これはIdentity Serverを参照していますが、SSLを設定する際に何か不足していると思います。"リモート証明書は検証手順によって無効です"

次のように私はセットアップを持っている(これはIISとあるではない、完全なIISを発現する):

私はライン上のタイトルにエラーが表示されます。

app.UseIdentityServerBearerTokenAuthentication(options); 

は、これはBAですauth.testhost.com:44373/core/.well-known/openid-configurationにあるサーバーからいくつかの開いている設定オプションを要求します。

私のオプションは次のとおりです。いくつかの例では

Authority = "https://auth.testhost.com:44373/core", 
RequiredScopes = new List<string>() { "api" } 

私はクライアントIDとシークレットを見るが、彼らは私のためのオプションでは使用できません。これは問題でしょうか?

アイデンティティサーバーのオプションが必要な場合は、私が投稿してください。 私が証明書を作成するには、次のコマンドを実行しました:

makecert.exe -r -pe -n "CN=auth.testhost.com" -b 01/01/2000 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 -len 2048 

これは私がその後、信頼されたルート証明機関にエクスポートした証明書を、生成されました。

IIS Expressを使用しているので、SSLポートバインディングをVisual Studioで処理する必要があります。以下は、それが持っているバインディングです:

127.0.0.1    localhost 
127.0.0.1    hybrid.testhost.com 
127.0.0.1    auth.testhost.com 

私はhttps://auth.testhost.com:44373/に行くとき、私はまだ私のプロトコルを介して赤のラインを持っている:

<site name="Authenticator_V2" id="2"> 
       <application path="/" applicationPool="Clr4IntegratedAppPool"> 
        <virtualDirectory path="/" physicalPath="c:\users\user\documents\visual studio 2015\Projects\Authenticator_V2\Authenticator_V2" /> 
       </application> 
       <bindings> 
        <binding protocol="http" bindingInformation="*:49755:localhost" /> 
        <binding protocol="https" bindingInformation="*:44373:localhost" /> 
        <binding protocol="https" bindingInformation="*:44373:auth.testhost.com" /> 
       </bindings> 
      </site> 
<site name="APIClient2" id="7"> 
       <application path="/" applicationPool="Clr4IntegratedAppPool"> 
        <virtualDirectory path="/" physicalPath="C:\Users\user\documents\visual studio 2015\Projects\Authenticator_V2\APIClient2" /> 
       </application> 
       <bindings> 
        <binding protocol="http" bindingInformation="*:53812:localhost" /> 
        <binding protocol="https" bindingInformation="*:44356:localhost" /> 
       </bindings> 
      </site> 

これは私のhostsファイルです。これは何かが正しく設定されていないことを意味します。私はChromeを使用して、証明書をクリックすると、与えています:

"Your connection to this site is not private." 

詳細:

SHA-1 Certificate 
The certificate for this site expires in 2017 or later, and the certificate chain contains a certificate signed using SHA-1. 

View certificate 

Certificate Error 
There are issues with the site's certificate chain (net::ERR_CERT_COMMON_NAME_INVALID). 

私はERR_CERT_COMMON_NAME_INVALIDエラーを見て、それはクロームのバグであると思われます。しかし、私のエラーは、私はこの1つを無視することができると思うので、認証サーバーに接続しようとしているWebサービスサーバーからスローされている???

私はまた、セットアップバインディング証明書があったチェックしてnetshを実行しました:

netsh http show sslcert ipport=0.0.0.0:44373 

SSL Certificate bindings: 
------------------------- 

    IP:port      : 0.0.0.0:44373 
    Certificate Hash    : HAS ODD HASH - REMOVED 
    Application ID    : {HAS GUID - REMOVED} 
    Certificate Store Name  : MY 
    Verify Client Certificate Revocation : Enabled 
    Verify Revocation Using Cached Client Certificate Only : Disabled 
    Usage Check     : Enabled 
    Revocation Freshness Time : 0 
    URL Retrieval Timeout  : 0 
    Ctl Identifier    : (null) 
    Ctl Store Name    : (null) 
    DS Mapper Usage    : Disabled 
    Negotiate Client Certificate : Disabled 
    Reject Connections   : Disabled 

この時点で気づいこのハッシュは、私の証明のために正しいものではありません。これは、IIS Expressローカルホスト用です。私はこのリンク:IdentityServer: The remote certificate is invalid according to the validation procedureを見つけ、ローカルホスト証明書を信頼できるルート証明機関に移動するための手順をコピーしましたが、残念ながら私はまだエラーがあります。私は今何をすべきか分かりません。

スコープ構成:

new Scope 
{ 
    Name = "api", 
    DisplayName = "Can call API", 
    Enabled = true, 
    Type = ScopeType.Resource 
    //ScopeSecrets = new List<Secret> { } 
} 

すべての私のクライアントは、このスコープを持っています。

おかげ

+0

「コンピュータアカウント」の「信頼できるルート証明機関」ストアに証明書が確実に追加されていますか?管理者権限で 'MMC.exe'を実行し、'コンピュータアカウント 'を選択する必要があります – Seany84

+0

こんにちは、私はそう信じています。私はウィンドウにいて、auth.testhost.com用に作成した証明書とIIS Expressが使用するlocalhostの証明書の両方がそこにあります。 – user2330270

+0

現在のMMCウィンドウを閉じて管理者権限でもう一度開くことができますか?コンピュータアカウントを選択し、証明書がまだ存在するかどうかを確認できますか? – Seany84

答えて

1

この問題は、ベアラ・オプションに証明書と発行者名を設定するオプションを与えた最新バージョンにIdentityModel.Jwtが、すべてをアップグレードすることで修正されました。どちらもエラーがなくなるように設定する必要があります

関連する問題