21
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

cURLでクライアント証明書を指定するには./が必要

Posted at

クライアント証明書による認証の設定がうまくっているのか確認するときにcurlを使ったりしますが、以下ではうまく動きません。400 Bad Requestになってしまいます。

$ curl --key client.key --cert client.cer https://localhost/
<html>
<head><title>400 No required SSL certificate was sent</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>No required SSL certificate was sent</center>
<hr><center>nginx/1.8.0</center>
</body>
</html>

./が暗黙に補完されるということはないので、以下のように明示する必要があります。

$ curl --key ./client.key --cert ./client.cer https://localhost/ 
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
</head>
<body>
<h1>You are authenticated by client certificate.</h1>
</body>
</html>

いつも./つけるの忘れて30分とか時間を無駄にするので、Qiitaに書いておく。

Using SSL client certificate authentication wit... | Qualys Community

21
14
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
21
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?