Skip to content

Commit 5bfdea5

Browse files
committed
Support for https under MS Windows
https is supported by the underlying Windows http api. Note: http_listener.cpp is not pulled in for WinRT and WinXP builds.
1 parent cb2e243 commit 5bfdea5

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

Release/src/http/listener/http_listener.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,24 @@ static void check_listener_uri(const http::uri &address)
3939
{
4040
// Somethings like proper URI schema are verified by the URI class.
4141
// We only need to check certain things specific to HTTP.
42-
if(address.scheme() == U("https"))
43-
{
44-
throw std::invalid_argument("Listeners using 'https' are not yet supported");
45-
}
4642

47-
if(address.scheme() != U("http"))
48-
{
49-
throw std::invalid_argument("URI scheme must be 'http'");
50-
}
43+
#ifdef _MS_WINDOWS
44+
//HTTP Server API includes SSL support
45+
if (address.scheme() != U("http") && address.scheme() != U("https"))
46+
{
47+
throw std::invalid_argument("URI scheme must be 'http' or 'https'");
48+
}
49+
#else
50+
if (address.scheme() == U("https"))
51+
{
52+
throw std::invalid_argument("Listeners using 'https' are not yet supported");
53+
}
54+
55+
if (address.scheme() != U("http"))
56+
{
57+
throw std::invalid_argument("URI scheme must be 'http'");
58+
}
59+
#endif
5160

5261
if(address.host().empty())
5362
{

0 commit comments

Comments
 (0)