Bug 42775 - System.Net.HttpListener.LoadCertificateAndKey should attempt to load certificates by address and port
Summary: System.Net.HttpListener.LoadCertificateAndKey should attempt to load certific...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: master
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
Depends on:
Reported: 2016-07-25 01:46 UTC by mmaguigan
Modified: 2016-07-25 10:57 UTC (History)
2 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description mmaguigan 2016-07-25 01:46:32 UTC
LoadCertificateAndKey, an internal method of System.Net.HttpListener, accepts the IP address and port of the binding end point as arguments, but does nothing with the address. Instead, it loads the certificate from the port number alone, forcing all addresses to be bound to the same certificate and private key.

Ideally LoadCertificateAndKey would try to load by address and port, than fall back to loading by port. This would provide backwards compatibility with existing setups while allowing new implementations to bind different certificates to different IP addresses.

If a pull request would help, I'd be happy to submit one.

https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/HttpListener.cs#L90 (link valid as of b48cd9b3c1fff64fabb8bff923ad06d047e6247d)

Note You need to log in before you can comment on or make changes to this bug.