25

inetsライブラリを試しましたが、タイムアウトしました。HTTPSをサポートしているとは思いません。ibrowseを使おうとしていますが、機能しません。

4

3 に答える 3

31

これは私にとってはうまくいきます:

1> application:start(inets).
ok
2> application:start(ssl).  
ok
3> http:request(head, {"https://example.com", []}, [{ssl,[{verify,0}]}], []).
{ok,{{"HTTP/1.1",200,"OK"},
     [{"cache-control","max-age=0, proxy-revalidate"},
      {"date","Sun, 23 May 2010 00:38:33 GMT"},
      {"server","BAIDA/1.0.0"},
      {"content-type","text/html; charset=windows-1251"},
      {"expires","Sun, 23 May 2010 00:38:33 GMT"},
      {"set-cookie",
       "uid=9041986921274575113; domain=.example.com; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT"}],
     []}}

http:request("https://example.com")ただし、リクエストする前に適切なアプリケーションをロードする必要があります。

于 2010-05-22T01:51:08.843 に答える
3

これは私のために働いたものです:

application:start(crypto),
application:start(public_key),
application:start(ssl),
application:start(inets).

httpc:request(head, {"https://example.com", []}, [{ssl,[{verify,0}]}], []).
于 2019-03-05T21:21:23.183 に答える
0

私にとって、これはErlang / OTP24のYaws2.1.0で(ピア検証が有効になっている)getリクエストに対して機能しました:

application:start(inets).
application:start(crypto).
application:start(asn1).
application:start(public_key).
application:start(ssl).

httpc:request(get, {"https://example.com", []}, 
    [{ssl, [{verify, verify_peer}, {cacertfile,"/path/to/cacertfile.crt"}]}], []).

それ以外の場合は、警告が表示されます。"Authenticity is not established by certificate path validation"

その他のオプションについては、https ://www.erlang.org/doc/man/httpc.html#request-4を参照してください。

于 2022-02-01T23:29:50.860 に答える