Skip to content

Commit

Permalink
Fix: was not possible to run the server on port 80/443 when using <us…
Browse files Browse the repository at this point in the history
…er> in config file

Regression during switch to cohttp
  • Loading branch information
balat committed Sep 30, 2022
1 parent 852f72a commit 0f250bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ocsigenserver.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
opam-version: "2.0"
name: "ocsigenserver"
version: "5.0.1"
version: "5.0.2"
maintainer: "dev@ocsigen.org"
synopsis: "A full-featured and extensible Web server"
description: "Ocsigen Server implements most features of the HTTP protocol, and has a very powerful extension mechanism that makes it very easy to plug your own OCaml modules for generating pages. Many extensions are already implemented, like a reverse proxy, content compression, access control, authentication, etc."
Expand Down
25 changes: 13 additions & 12 deletions src/server/ocsigen_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,18 @@ let start ?config () =
| l, Some (crt, key) -> List.map (fun (a, p) -> a, p, (crt, key)) l
| _ -> []
in
let listeners =
List.map
(fun (address, port) ->
Ocsigen_cohttp.service ~address ~port
~connector:extensions_connector ())
connection
@ (List.map (fun (address, port, (crt, key)) ->
Ocsigen_cohttp.service
~ssl:(crt, key, Some (ask_for_passwd [address, port]))
~address ~port ~connector:extensions_connector ()))
ssl_connection
in
let current_uid = Unix.getuid () in
let gid =
match group with
Expand Down Expand Up @@ -438,18 +450,7 @@ let start ?config () =
>>= f
in
ignore (f ());
Lwt_main.run
@@ Lwt.join
(List.map
(fun (address, port) ->
Ocsigen_cohttp.service ~address ~port
~connector:extensions_connector ())
connection
@ (List.map (fun (address, port, (crt, key)) ->
Ocsigen_cohttp.service
~ssl:(crt, key, Some (ask_for_passwd [address, port]))
~address ~port ~connector:extensions_connector ()))
ssl_connection)
Lwt_main.run @@ Lwt.join listeners
(*
Ocsigen_messages.warning "Ocsigen has been launched (initialisations ok)";
Expand Down

0 comments on commit 0f250bf

Please sign in to comment.