LoginSignup
1
0

More than 1 year has passed since last update.

OCamlのCohttpで No SSL or TLS support compiled into Conduit という実行時エラーになってしまった時

Posted at

OCamlで例えば次のようなCohttpの簡単なコードでhttpsのサイトをGETしようとしたらエラーが出た。

main.ml
let as_string uri =
  Client.get (Uri.of_string uri) >>= fun (_resp, body) ->
  Cohttp_lwt.Body.to_string body

エラー内容:

Fatal error: exception Failure("No SSL or TLS support compiled into Conduit")
Raised at Lwt.Miscellaneous.poll in file "src/core/lwt.ml", line 3068, characters 20-29
Called from Lwt_main.run.run_loop in file "src/unix/lwt_main.ml", line 31, characters 10-20
Called from Lwt_main.run in file "src/unix/lwt_main.ml", line 118, characters 8-13
Re-raised at Lwt_main.run in file "src/unix/lwt_main.ml", line 124, characters 4-13
Called from Dune__exe__Main in file "src/main.ml", line 18, characters 2-24

opam install lwt_ssl しようとしても次のようなエラーになるのは関係があるかもしれない。

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
[ERROR] The compilation of conf-libssl failed at "/Users/mube/.opam/opam-init/hooks/sandbox.sh build sh -ex ./homebrew.sh check".

#=== ERROR while compiling conf-libssl.4 ======================================#
# context     2.0.7 | macos/x86_64 | ocaml-base-compiler.4.14.0 | https://opam.ocaml.org#13c823a5
# path        ~/.opam/default/.opam-switch/build/conf-libssl.4
# command     ~/.opam/opam-init/hooks/sandbox.sh build sh -ex ./homebrew.sh check
# exit-code   1
# env-file    ~/.opam/log/conf-libssl-94721-d6d332.env
# output-file ~/.opam/log/conf-libssl-94721-d6d332.out
### output ###
# ++ brew --prefix openssl
# + brew_pkg_config=/usr/local/opt/openssl@3/lib/pkgconfig
# + case "$1" in
# + test 1 '!=' 1
# + export PKG_CONFIG_PATH=/usr/local/opt/openssl@3/lib/pkgconfig:
# + PKG_CONFIG_PATH=/usr/local/opt/openssl@3/lib/pkgconfig:
# + pkg-config --print-errors --exists openssl
# Package openssl was not found in the pkg-config search path.
# Perhaps you should add the directory containing `openssl.pc'
# to the PKG_CONFIG_PATH environment variable
# No package 'openssl' found



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
┌─ The following actions failed
│ λ build conf-libssl 4
└─ 
╶─ No changes have been performed

The packages you requested declare the following system dependencies. Please make sure they are installed before retrying:
    openssl

どうやら、自分のMac環境のopensslが古いようだ。brewでupgradeすることで解決した。

brew install openssl
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0