Konfigurieren von SSL in ASP.NET Self-Hosted Web API

Ich bin erstellen von Self-hosted-Web-API-service. Um es zu sichern, habe ich studiert und umgesetzt diese Artikel, erfolgreich erzeugt einen lokalen SSL-Zertifikat mit makecert und meinen Dienst authentifiziert und generiert Token in Ordnung, wenn ich mit

http://localhost/webapi/authentication/authenticate

link, aber wenn ich versuche, auf meinen Dienst mit HTTPS, bekomme ich folgende Firefox -:

ssl_error_rx_record_too_long

und für dieselbe Anforderung Fiddler zeigt mir:

HTTP/1.1 502 Fiedler - Verbindung Fehlgeschlagen Datum: Mon, 26 Aug 2013
10:44:27 GMT Content-Type: text/html; charset=UTF-8 Connection: close
Timestamp: 13:44:27.433

[Fiddler] Die socket-Verbindung zu localhost fehlgeschlagen.
Fehler beim
verhandeln HTTPS-Verbindung mit dem server.fiddler'.Netzwerk.https - >
Fehlgeschlagene Sicherung bestehender Verbindung zum localhost. Die handshake
konnte aufgrund eines unerwarteten Paket-format..

Mein self-host-Konfiguration:

    private HttpSelfHostServer _server;
    private ExtendedHttpsSelfHostConfiguration _config;
    public const string ServiceAddress = "https://localhost/webapi";
    _config = new ExtendedHttpsSelfHostConfiguration(ServiceAddress);
    _server = new HttpSelfHostServer(_config);
    _server.OpenAsync();

wo ExtendedHttpSelfHostConfiguration entnommen dieser Beitrag ist:

public class ExtendedHttpSelfHostConfiguration : HttpSelfHostConfiguration
{
    public ExtendedHttpSelfHostConfiguration(string baseAddress) : base(baseAddress) { }
    public ExtendedHttpSelfHostConfiguration(Uri baseAddress) : base(baseAddress) { }

    protected override BindingParameterCollection OnConfigureBinding(HttpBinding httpBinding)
    {
        if (BaseAddress.ToString().ToLower().Contains("https://"))
        {
            httpBinding.Security.Mode = HttpBindingSecurityMode.Transport;
        }

        return base.OnConfigureBinding(httpBinding);
    }
}

Was mir fehlt?
Vielen Dank im Voraus!

InformationsquelleAutor der Frage insomnium_ | 2013-08-26

Schreibe einen Kommentar