EAP 設定

本文提供為 VPN 配置檔建立可延伸驗證通訊協定 (EAP) 組態 XML 的逐步指南,包括 Windows 10 中 EAP 憑證篩選的相關信息。

建立 VPN 設定檔的 EAP 組態 XML

若要使用隨附於方塊中的 rasphone 工具,從您的桌面取得 EAP 組態:

  1. 執行 rasphone.exe。

    vpnv2 rasphone。

  2. 如果您目前沒有 VPN 連線,而且看到下列訊息,請選取 [ 確定]

    vpnv2 csp 網路連線。

  3. 在精靈中,選取 [ 工作場所網络]

    vpnv2 csp 設定連線。

  4. 輸入因特網位址和連線名稱。 這些詳細數據可能是假的,因為它不會影響驗證參數。

    vpnv2 csp 設定連線 2。

  5. 建立假的 VPN 連線。 在此顯示的 UI 中,選取 [ 屬性]

    vpnv2 csp 選擇 nw 連線。

  6. 在 [ 測試屬性] 對話框中,選取 [ 安全性] 索引 標籤。

    vpnv2 csp 測試屬性。

  7. 在 [ 安全性] 索引標籤上,選取 [ 使用可延伸驗證通訊協定 (EAP) ] 。

    vpnv2 csp 測試 props2。

  8. 從下拉功能表中,選取您要設定的 EAP 方法, 然後選取 [屬性] 以視需要進行設定。

    vpnv2 csp 測試 props3。vpnv2 csp 測試 props4

  9. 切換至 PowerShell,並使用下列 Cmdlet 擷取 EAP 組態 XML。

    Get-VpnConnection -Name Test
    

    以下是範例輸出。

    Name                  : Test
    ServerAddress         : 1.1.1.1
    AllUserConnection     : False
    Guid                  : {EC87F6C9-8823-416C-B92B-517D592E250F}
    TunnelType            : Automatic
    AuthenticationMethod  : {Eap}
    EncryptionLevel       : Optional
    L2tpIPsecAuth         : Certificate
    UseWinlogonCredential : False
    EapConfigXmlStream    : #document
    ConnectionStatus      : Disconnected
    RememberCredential    : True
    SplitTunneling        : False
    DnsSuffix             :
    IdleDisconnectSeconds : 0
    
    $a = Get-VpnConnection -Name Test
    
    $a.EapConfigXmlStream.InnerXml
    

    以下是範例輸出。

    <EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
      <EapMethod>
        <Type xmlns="http://www.microsoft.com/provisioning/EapCommon">13</Type>
        <VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId>
        <VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType>
        <AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</AuthorId>
      </EapMethod>
      <Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
        <Eap xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1">
          <Type>13</Type>
          <EapType xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV1">
            <CredentialsSource>
              <CertificateStore>
                <SimpleCertSelection>true</SimpleCertSelection>
              </CertificateStore>
            </CredentialsSource>
            <ServerValidation>
              <DisableUserPromptForServerValidation>false</DisableUserPromptForServerValidation>
              <ServerNames />
            </ServerValidation>
            <DifferentUsername>false</DifferentUsername>
            <PerformServerValidation xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2">true</PerformServerValidation>
            <AcceptServerName xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2">true</AcceptServerName>
            <TLSExtensions xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2">
              <FilteringInfo xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV3">
                <ClientAuthEKUList Enabled="true" />
                <AnyPurposeEKUList Enabled="true" />
              </FilteringInfo>
            </TLSExtensions>
          </EapType>
        </Eap>
      </Config>
    </EapHostConfig>
    

    注意

    如果您需要以逸出格式傳遞此 XML,您應該洽詢行動 裝置管理 (MDM) 廠商。 所有 EAP 方法的 XSD 都會隨附於方塊中,並可在下列位置找到:

    • C:\Windows\schemas\EAPHost
    • C:\Windows\schemas\EAPMethods

EAP 憑證篩選

在您的部署中,如果您已在裝置上布建多個憑證,且布建的 Wi-Fi 配置檔沒有嚴格的篩選準則,您可能會在連線到Wi-Fi時看到連線失敗。 解決方案是確保布建的 Wi-Fi 配置檔具有嚴格的篩選準則,使其只符合一個憑證。

針對 VPN 和 Wi-Fi 部署憑證型 EAP 驗證的企業,可能會遇到多個憑證符合預設驗證準則的情況。 這種情況可能會導致下列問題:

  • 系統可能會提示用戶選取憑證。
  • 可能會自動選取錯誤的憑證,並導致驗證失敗。

生產環境就緒部署必須具有適當的憑證詳細數據,作為所部署配置檔的一部分。 下列資訊說明如何建立或更新 EAP 組態 XML,以便篩選掉無關的憑證,並使用適當的憑證進行驗證。

EAP XML 必須以您環境的相關信息進行更新。 您可以編輯下列 XML 範例或使用逐步 UI 指南,手動完成這項工作。 更新EAP XML之後,請參閱 MDM 中的指示以部署更新的組態,如下所示:

  • 針對Wi-Fi,尋找 <EAPConfig> 您目前 WLAN 設定檔 XML 的 區段。 (本節是您在 Wi-Fi CSP.) 中為 WLanXml 節點指定的內容。在這些標籤中,您會找到完整的 EAP 組態。 將 底下的 <EAPConfig> 區段取代為更新的 XML,並更新您的 Wi-Fi 設定檔。 您可以參考 MDM 關於如何部署新 Wi-Fi 設定檔的指引。
  • 針對 VPN,EAP 組態是 MDM 組態中的個別欄位。 請與您的 MDM 提供者合作,以識別並更新適當的欄位。

如需 EAP 設定的相關信息,請參閱 適用於網路存取的可延伸驗證通訊協定 (EAP)

如需產生 EAP XML 的相關信息,請參閱 EAP 組態一文。

如需擴充金鑰使用 (EKU) 的詳細資訊,請參閱 https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.12

如需將 EKU 新增至憑證的相關信息,請參閱 https://technet.microsoft.com/library/cc731792.aspx

下列清單描述要搭配 EAP 使用憑證的必要條件:

  • 憑證必須至少有下列其中一個 EKU 屬性:

    • 客戶端驗證:如 RFC 5280 所定義,此屬性是定義完善的 OID,值為 1.3.6.1.5.5.7.3.2。
    • 任何用途:此屬性是 EKU 定義的屬性,由 Microsoft 發佈。 它是定義完善的 OID,值為 1.3.6.1.4.1.311.10.12.1。 包含此 OID 表示憑證可用於任何用途。 此 EKU 優於所有用途 EKU 的優點是,其他非關鍵性或自定義 EKU 仍可新增至憑證以進行有效篩選。
    • 所有用途:如 RFC 5280 所定義,如果 CA 包含滿足某些應用程式需求的 EKU,但不想要限制密鑰的使用方式,CA 可以新增 0 的 EKU 值。 具有這類 EKU 的憑證可用於所有用途。
  • 用戶端上的使用者或計算機憑證必須鏈結至受信任的根 CA。

  • 使用者或計算機憑證不會對 CryptoAPI 證書儲存所執行的任何檢查失敗,而且憑證會在遠端訪問原則中通過需求。

  • 使用者或計算機憑證不會對因特網驗證服務中指定的任何憑證對象標識元檢查失敗, (IAS) /Radius Server。

  • 憑證中 SubjectAltName) 擴展名 (主體別名包含使用者的 UPN) (用戶主體名稱。

下列 XML 範例說明 EAP TLS XML 的屬性,包括憑證篩選。

注意

針對PEAP或TTLS配置檔,EAP TLS XML會內嵌在某些PEAP特定或TTLS特定元素內。

<EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
 <EapMethod>
  <Type xmlns="http://www.microsoft.com/provisioning/EapCommon">13</Type>
  <!--The above property defines the Method type for EAP, 13 means EAP TLS -->

  <VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId>
  <VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType>
  <AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</AuthorId>
  <!--The 3 properties above define the method publishers, this is seen primarily in 3rd party Vendor methods.-->
  <!-- For Microsoft EAP TLS the value of the above fields will always be 0 -->
 </EapMethod>
 <!-- Now that the EAP Method is Defined we will go into the Configuration -->
 <Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
  <Eap xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1">
   <Type>13</Type>
   <EapType xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV1">
    <CredentialsSource>
     <!-- Credential Source can be either CertificateStore or SmartCard -->
     <CertificateStore>
      <SimpleCertSelection>true</SimpleCertSelection>
      <!--SimpleCertSelection automatically selects a cert if there are mutiple identical (Same UPN, Issuer, etc.) certs.-->
      <!--It uses a combination of rules to select the right cert-->
     </CertificateStore>
    </CredentialsSource>
    <ServerValidation>
     <!-- ServerValidation fields allow for checks on whether the server being connected to and the server cert being used are trusted -->
     <DisableUserPromptForServerValidation>false</DisableUserPromptForServerValidation>
     <ServerNames/>
    </ServerValidation>
    <DifferentUsername>false</DifferentUsername>
    <PerformServerValidation xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2">false</PerformServerValidation>
    <AcceptServerName xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2">false</AcceptServerName>
    <TLSExtensions xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2">
     <!-- For filtering the relevant information is below -->
     <FilteringInfo xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV3">
      <CAHashList Enabled="true">
       <!-- The above implies that you want to filter by Issuer Hash -->
       <IssuerHash>ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
        <!-- Issuing certs thumbprint goes here-->
       </IssuerHash>
       <!-- You can add multiple entries and it will find the list of certs that have at least one of these certs in its chain-->
      </CAHashList>
      <EKUMapping>
       <!-- This section defines Custom EKUs that you may be adding-->
       <!-- You do not need this section if you do not have custom EKUs -->
       <!-- You can have multiple EKUs defined here and then referenced below as shown -->
       <EKUMap>
        <EKUName>
         <!--Add a friendly Name for an EKU here for example -->ContostoITEKU</EKUName>
        <EKUOID>
         <!--Add the OID Value your CA adds to the certificate here, for example -->1.3.6.1.4.1.311.42.1.15</EKUOID>
       </EKUMap>
        <!-- All the EKU Names referenced in the example below must first be defined here
       <EKUMap>
        <EKUName>Example1</EKUName>
        <EKUOID>2.23.133.8.3</EKUOID>

       </EKUMap>
       <EKUMap>
        <EKUName>Example2</EKUName>
        <EKUOID>1.3.6.1.4.1.311.20.2.1</EKUOID>
       </EKUMap>
       -->
      </EKUMapping>
      <ClientAuthEKUList Enabled="true">
       <!-- The above implies that you want certs with Client Authentication EKU to be used for authentication -->
       <EKUMapInList>
        <!-- This section implies that the certificate should have the following custom EKUs in addition to the Client Authentication EKU -->
        <EKUName>
         <!--Use the name from the EKUMap Field above-->ContostoITEKU</EKUName>
       </EKUMapInList>
       <!-- You can have multiple Custom EKUs mapped here, Each additional EKU will be processed with an AND operand -->
       <!-- For example, Client Auth EKU AND ContosoITEKU AND Example1 etc. -->
       <EKUMapInList>
        <EKUName>Example1</EKUName>
       </EKUMapInList>
      </ClientAuthEKUList>
      <AllPurposeEnabled>true</AllPurposeEnabled>
      <!-- Implies that a certificate with the EKU field = 0 will be selected -->
      <AnyPurposeEKUList Enabled="true"/>
      <!-- Implies that a certificate with the EKU oid Value of 1.3.6.1.4.1.311.10.12.1 will be selected -->
      <!-- Like for Client Auth you can also add Custom EKU properties with AnyPurposeEKUList (but not with AllPurposeEnabled) -->
      <!-- So here is what the above policy implies.
      The certificate selected will have
      Issuer Thumbprint = ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      AND
      ((Client Authentication EKU AND ContosoITEKU) OR (AnyPurposeEKU) OR AllPurpose Certificate)

      Any certificate(s) that match these criteria will be utilised for authentication
      -->
     </FilteringInfo>
    </TLSExtensions>
   </EapType>
  </Eap>
 </Config>
</EapHostConfig>

注意

EAP TLS XSD 位於 %systemdrive%\Windows\schemas\EAPMethods\eaptlsconnectionpropertiesv3.xsd。

或者,您可以使用下列程式來建立 EAP 組態 XML:

  1. 請遵循 EAP 設定一文中的步驟 1 到 7。

  2. 在 [ Microsoft VPN SelfHost 屬性 ] 對話框中,從下拉功能表中選取 [ Microsoft:智慧卡或其他憑證 (此值會選取 [EAP TLS) ]。

    vpn 自我主機屬性視窗。

    注意

    針對 [PEAP] 或 [TTLS],選取適當的方法,然後繼續遵循此程式。

  3. 選取下拉功能表下的 [ 屬性 ] 按鈕。

  4. 在 [ 智慧卡或其他憑證內容] 功能表上,選取 [ 進階 ] 按鈕。

    智慧卡或其他憑證屬性視窗。

  5. 在 [ 設定憑證選 取] 功能表上,視需要調整篩選。

    設定憑證視窗。

  6. 選取 [確定 ] 以關閉視窗,並返回主要 rasphone.exe 對話框。

  7. 關閉 rasphone 對話框。

  8. 繼續遵循步驟 9 中 EAP 組態一文中的程式,以取得具有適當篩選的 EAP TLS 配置檔。

注意

您也可以透過此 UI 設定所有其他適用的 EAP 屬性。 如需這些屬性的意義指南,請參閱 適用於網路存取的可延伸驗證通訊協定 (EAP) 一文。

設定服務提供者參考