Problem mit der Verbindung zum Enterprise-WLAN-Netzwerk

Problem mit der Verbindung zum Enterprise-WLAN-Netzwerk

Ich habe den Radius-Server auf Windows Server 2016 konfiguriert und möchte mithilfe meiner Anwendung eine Verbindung zum Enterprise WiFi-Netzwerk herstellen. Ich habe versucht, die folgenden Schritte auszuführen:

Richten Sie das Profil ohne Anmeldeinformationen ein mitWlanSetProfile(Ich habe ein importiertes Profil von Netsh mit einigen Änderungen verwendet)

Legen Sie dann das unten stehende XML-Profil mit meinem Benutzernamen und Passwort fest aufWlanSetProfileEapXmlUserData:

<?xml version="1.0" ?> 
 <EapHostUserCredentials xmlns="http://www.microsoft.com/provisioning/EapHostUserCredentials" 
   xmlns:eapCommon="http://www.microsoft.com/provisioning/EapCommon" 
   xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapMethodUserCredentials">
   <EapMethod>
     <eapCommon:Type>26</eapCommon:Type> 
     <eapCommon:AuthorId>0</eapCommon:AuthorId> 
   </EapMethod>
   <Credentials xmlns:eapUser="http://www.microsoft.com/provisioning/EapUserPropertiesV1" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapUserPropertiesV1" 
     xmlns:MsPeap="http://www.microsoft.com/provisioning/MsPeapUserPropertiesV1" 
     xmlns:MsChapV2="http://www.microsoft.com/provisioning/MsChapV2UserPropertiesV1">
     <baseEap:Eap>
       <baseEap:Type>26</baseEap:Type> 
       <MsChapV2:EapType>
         <MsChapV2:Username>test</MsChapV2:Username> 
         <MsChapV2:Password>test</MsChapV2:Password> 
       </MsChapV2:EapType>
     </baseEap:Eap>
   </Credentials>
 </EapHostUserCredentials>

Dann benutze ichWlanConnectFunktion und Rückruffunktion zum Überprüfen der Verbindung. Beim Verbinden tritt das folgende Problem auf:

NotificationCode gibt Code 8 (wlan_notification_acm_scan_fail) und dann 11 (wlan_notification_acm_connection_attempt_fail) zurück.

Außerdem aus MS-Dokumenten:

wlan_notification_acm_scan_fail:

Ein Scan nach verbindbaren Netzwerken ist fehlgeschlagen.

Das pData-Element der WLAN_NOTIFICATION_DATA-Struktur verweist auf einen WLAN_REASON_CODE-Datentypwert, der den Grund für den fehlgeschlagenen WLAN-Vorgang angibt.

Ich habe also die pData geprüft, wenn dieses Problem auftritt, und sie geben den folgenden Grund zurück:

wlan_notification_acm_scan_fail "Der Vorgang war erfolgreich."

Aber das Netzwerk ist nicht verbunden. Vielen Dank im Voraus für Ihre Hilfe.

Antwort1

Ich habe dieses Problem behoben. Das Problem lag darin, dass PerformServerValidation auf true gesetzt war und der Benachrichtigungsdialog zur Überprüfung des Zertifikats unter Windows angezeigt wurde. Deshalb wurde Folgendes zurückgegeben:

wlan_notification_acm_scan_fail "Der Vorgang war erfolgreich."

Das Problem wurde behoben, indem „PerformServerValidation“ auf „false“ gesetzt wurde (Funktion „WlanSetProfile“).

<PerformServerValidation xmlns=\"http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2\">false</PerformServerValidation>

Außerdem habe ich für die Funktion WlanSetProfileEapXmlUserData dieses Profil bereitgestellt:

<?xml version="1.0" ?>
<EapHostUserCredentials
xmlns="http://www.microsoft.com/provisioning/EapHostUserCredentials"
xmlns:eapCommon="http://www.microsoft.com/provisioning/EapCommon"
xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapMethodUserCredentials">
<EapMethod>
<eapCommon:Type>25</eapCommon:Type>
<eapCommon:AuthorId>0</eapCommon:AuthorId>
</EapMethod>
<Credentials
xmlns:eapUser="http://www.microsoft.com/provisioning/EapUserPropertiesV1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapUserPropertiesV1"
xmlns:MsPeap="http://www.microsoft.com/provisioning/MsPeapUserPropertiesV1"
xmlns:MsChapV2="http://www.microsoft.com/provisioning/MsChapV2UserPropertiesV1">
<baseEap:Eap>
<baseEap:Type>25</baseEap:Type>
<MsPeap:EapType>
<baseEap:Eap>
<baseEap:Type>26</baseEap:Type>
<MsChapV2:EapType>
<MsChapV2:Username>username</MsChapV2:Username>
<MsChapV2:Password>password</MsChapV2:Password>
</MsChapV2:EapType>
</baseEap:Eap>
</MsPeap:EapType>
</baseEap:Eap>
</Credentials>
</EapHostUserCredentials>

Jetzt wird die Verbindung zum Unternehmensnetzwerk erfolgreich hergestellt. Das Problem ist behoben. Vielen Dank.

verwandte Informationen