{"id":24022190,"url":"https://github.com/smondet/cohttps-server-example","last_synced_at":"2025-04-15T21:48:53.668Z","repository":{"id":12502843,"uuid":"15172448","full_name":"smondet/cohttps-server-example","owner":"smondet","description":"Short code example of an HTTPS server using Cohttp/Lwt-ssl","archived":false,"fork":false,"pushed_at":"2013-12-13T22:23:33.000Z","size":124,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-15T21:48:48.082Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smondet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-13T19:46:59.000Z","updated_at":"2019-01-15T09:54:39.000Z","dependencies_parsed_at":"2022-08-31T13:22:21.482Z","dependency_job_id":null,"html_url":"https://github.com/smondet/cohttps-server-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smondet%2Fcohttps-server-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smondet%2Fcohttps-server-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smondet%2Fcohttps-server-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smondet%2Fcohttps-server-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smondet","download_url":"https://codeload.github.com/smondet/cohttps-server-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249161104,"owners_count":21222468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-08T13:02:10.084Z","updated_at":"2025-04-15T21:48:53.651Z","avatar_url":"https://github.com/smondet.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"Quick Example Code\n==================\n\nThis is a *minimalistic* piece of code showing the creation of an HTTPS server\nusing `cohttp.lwt` and `lwt.ssl`.\n\nThere is not really any error management or parametrization to keep the code\nshort.\n\nIt is ISC licensed, copy at will.\n\nBuild \u0026 Run\n-----------\n\nCompile like this:\n\n    ocamlfind ocamlc -package lwt.ssl,cohttp.lwt -linkpkg cohttps.ml -o dummyserver\n\nCreate an OpenSSL self-signed certificate:\n\n    openssl genrsa -des3 -out privkey.pem 1024\n    openssl req -new -x509 -days 1001 -key privkey.pem -out cert.pem\n    openssl rsa -in privkey.pem -out privkey-unsec.pem\n\nTest:\n\n     ./dummyserver\n\nBoth HTTP and HTTPS servers are created; go to \u003chttps://localhost:8081\u003e or\n\u003chttp://localhost:8082\u003e, it should display some HTML.\n\n\nOther Notes\n-----------\n\n### Using `TLSv1` instead of `SSLv23`\n\nWith `Ssl.TLSv1` and *Wget 1.10.2*, I need `--secure-protocol=TLSv1`:\n\n    wget --no-check-certificate --secure-protocol=TLSv1 https://\u003chost\u003e:8081\n\nwith Wget 1.14, I don't:\n\n    wget --no-check-certificate https://\u003chost\u003e:8081\n\nFirefox works without problem.\n\nOcsigenserver uses `SSLv23` (c.f.\n[`ocsigen_http_client.ml:88`](https://github.com/ocsigen/ocsigenserver/blob/master/src/server/ocsigen_http_client.ml#L88)).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmondet%2Fcohttps-server-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmondet%2Fcohttps-server-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmondet%2Fcohttps-server-example/lists"}