1
0

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 3 years have passed since last update.

GitLabのCI/CDパイプラインで no alternative certificate subject name matches target host name が出る

Posted at

GitLabとRunner (Docker) をDocker Composeで起動して、ゆるーくCI/CDパイプラインを試そうとしたときに出たエラー。
その原因と対応方法のメモ。

このメッセージが出た環境

このメッセージが出た環境。
赤字部分が今回の原因に関連するところ。

  • Docker Composeを使ってGitLabとRunner (Docker) を起動している。
  • DockerホストはAWS EC2上の適当なUbuntu。
  • プライベートCAでGitLabの証明書を発行し、それを使っている。
  • GitLabのexternal_urlgitlab.example.com

メッセージ全文

fatal: unable to access 'https://gitlab.example.com/privategroup01/privatepj01.git/': SSL: no alternative certificate subject name matches target host name 'gitlab.example.com'
qiita01.png

原因

プライベートCAで発行したGitLabの証明書のSANs (サブジェクト代替名) にexternal_urlgitlab.example.comが入っていなかった。
26ca6041793a43749d8a8569290eb38b.png

解決方法

メッセージに出ていたホスト名 (gitlab.example.com) をGitLabの証明書のSANsに追加して、発行しなおし。
発行しなおしたらそれをGitLab側に適用する。
コマンド gitlab-ctl reconfigure で設定反映させるか、もしくはコンテナ再起動する。
34b44adc9d064da6bc5aa98116f10119.png

以上。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?