ssl.cipher_suites/0 未定义或私有,使用 cipher_suites/2,3 代替 (ssl 10.4.1) :ssl.cipher_suites()

问题描述

** (UndefinedFunctionError) function :ssl.cipher_suites/0 is undefined or private,use cipher_suites/2,3 instead
    (ssl 10.4.1) :ssl.cipher_suites()
    (hackney 1.15.2) /Users/naveen/NAV/moviematch/deps/hackney/src/hackney_ssl.erl:77: :hackney_ssl.ciphers/0
    (hackney 1.15.2) /Users/naveen/NAV/moviematch/deps/hackney/src/hackney_ssl.erl:69: :hackney_ssl.connect/4
    (hackney 1.15.2) /Users/naveen/NAV/moviematch/deps/hackney/src/hackney_connect.erl:277: :hackney_connect.do_connect/5
    (hackney 1.15.2) /Users/naveen/NAV/moviematch/deps/hackney/src/hackney_connect.erl:47: :hackney_connect.connect/5
    (hackney 1.15.2) /Users/naveen/NAV/moviematch/deps/hackney/src/hackney.erl:333: :hackney.request/5
    (httpoison 1.8.0) lib/httpoison/base.ex:846: HTTPoison.Base.request/6

此处指定的项目依赖项: https://github.com/navyad/moviematch/blob/master/mix.exs#L22

当前 Elixir 版本:1.12 和 Erlang/OTP 24 我已将 httpoison 从 1.4 升级到 1.8

步骤

  • 混合 deps.get
  • 混合编译
  • iex -S 混合
  • MovieMatch.Imdb.fetch_imdb_watchlist("ur26610840")

解决方法

我不知道您为什么从 GitHub 而不是 Hex 中查看 Hackney,但我能够通过使用 mix deps update --all 升级您的依赖项来解决您的问题:

$ mix deps.update --all
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  floki 0.20.4
  html_entities 0.4.0
  metrics 1.0.1
  mimerl 1.2.0
  poison 3.1.0
Upgraded:
  certifi 2.5.1 => 2.6.1
  httpoison 1.5.0 => 1.8.0
  idna 6.0.0 => 6.1.1
  mochiweb 2.18.0 => 2.20.1
  parse_trans 3.3.0 => 3.3.1
  ssl_verify_fun 1.1.5 => 1.1.6
  unicode_util_compat 0.4.1 => 0.7.0 (minor)
New:
* Updating httpoison (Hex package)
* Updating hackney (Hex package)
* Updating certifi (Hex package)
* Updating idna (Hex package)
* Updating parse_trans (Hex package)
* Updating ssl_verify_fun (Hex package)
* Updating unicode_util_compat (Hex package)
* Updating mochiweb (Hex package)

测试:

Generated moviematch app
Interactive Elixir (1.12.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> MovieMatch.Imdb.fetch_imdb_watchlist("ur26610840")

18:39:25.419 [info]  parsing html...

18:39:25.457 [info]  building json...
%{id: "tt11296058",title: "Kunstneren og tyven"}
%{id: "tt11655202",title: "Retfærdighedens ryttere"}
%{id: "tt8185182",title: "Diqiu zuihou de yewan"}
%{id: "tt8637428",title: "The Farewell"}
%{id: "tt8649190",title: "Here Before"}
%{id: "tt9601220",title: "Black Bear"}
%{id: "tt9639470",title: "Last Night in Soho"}

18:39:25.459 [info]  no. of imdb movies: 7
%{
  "tt11296058" => "Kunstneren og tyven","tt11655202" => "Retfærdighedens ryttere","tt8185182" => "Diqiu zuihou de yewan","tt8637428" => "The Farewell","tt8649190" => "Here Before","tt9601220" => "Black Bear","tt9639470" => "Last Night in Soho"
}

在 OTP 24.0.2 和 Elixir 1.12.1 上运行。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...