support combineing --socket with HTTPs
Might be useful when proxying? Dunno.
This commit is contained in:
parent
492c484a82
commit
ef30fa2fa9
1 changed files with 7 additions and 6 deletions
|
@ -188,13 +188,14 @@ runServer o mst = go `finally` serverShutdownCleanup mst
|
|||
Just socketpath ->
|
||||
withsocket socketpath $ \sock ->
|
||||
Warp.runSettingsSocket settings sock app
|
||||
(Just certfile, Just privatekeyfile) ->
|
||||
case socketOption o of
|
||||
Nothing -> do
|
||||
(Just certfile, Just privatekeyfile) -> do
|
||||
let tlssettings = Warp.tlsSettingsChain
|
||||
certfile (chainFileOption o) privatekeyfile
|
||||
Warp.runTLS tlssettings settings app
|
||||
Just _socketpath -> giveup "HTTPS is not supported with --socket"
|
||||
case socketOption o of
|
||||
Nothing -> Warp.runTLS tlssettings settings app
|
||||
Just socketpath ->
|
||||
withsocket socketpath $ \sock ->
|
||||
Warp.runTLSSocket tlssettings settings sock app
|
||||
_ -> giveup "You must use both --certfile and --privatekeyfile options to enable HTTPS."
|
||||
port = maybe
|
||||
(fromIntegral defaultP2PHttpProtocolPort)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue