VCSA 6.5.x/6.7.x 及び vCenter Server 7.0.x の「署名証明書が有効ではありません (Signing certificate is not valid)」エラー
search cancel

VCSA 6.5.x/6.7.x 及び vCenter Server 7.0.x の「署名証明書が有効ではありません (Signing certificate is not valid)」エラー

book

Article ID: 322143

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

この記事では、シェルスクリプトを使用して、VCSA 6.5.x、6.7.x、およびvCenter Server 7.0.xで期限切れのセキュリティトークンサービス(STS)証明書を再生成および置換する手順について説明します。
PowerShellスクリプトを使用してWindowsにインストールされたVMwarevCenter Server 6.5.xおよび6.7.xでSTS証明書を再生成および置換する手順については、「 "Signing certificate is not valid" - Regenerating and replacing expired STS certificate using PowerShell script on vCenter Server 6.5/6.7 installed on Windows 」を参照してください。

Symptoms:
免責事項: これは英文の記事 「"Signing certificate is not valid" - Regenerating and replacing expired STS certificate using shell script on vCenter Server Appliance 6.5/6.7」の日本語訳です。記事はベストエフォートで翻訳を進めているため、ローカライズ化コンテンツは最新情報ではない可能性があります。最新情報は英語版の記事で参照してください。

vCenter Server Appliance(VCSA)6.5.x、6.7.x、またはvCenter Server 7.0.xで、次の症状が発生します:
  • vmware-vpxdサービスの開始に失敗する
  • Web Client にログインすると、次のエラーが発生する。

    HTTP ステータス 400 – 不正な要求メッセージ:不正な要求、署名付き証明書が有効ではありません (HTTP Status 400 – Bad Request Message BadRequest, Signing certificate is not valid)
     
  • /var/log/vmware/vpxd-svcs/vpxd-svcs.logに次のエラーが記録される。
ERROR com.vmware.vim.sso.client.impl.SecurityTokenServiceImpl$RequestResponseProcessor opId=] Server rejected the provided time range.Cause:ns0:InvalidTimeRange: The token authority rejected an issue request for TimePeriod [startTime=Thu Jan 02 09:22:13 EST 2020, endTime=Fri Jan 03 09:22:13 EST 2020] :: Signing certificate is not valid at Thu Jan 02 09:22:13 EST 2020, cert validity: TimePeriod [startTime=Wed Jan 06 20:44:39 EST 2010, endTime=Wed Jan 01 20:54:23 EST 2020]

注:証明書の有効期限が切れている場合、endTime は過去の日付になります。
 
  • Web Client にログインすると、次のエラーが発生する。
503 Service Unavailable (Failed to connect to endpoint: [N7Vmacore4Http20NamedPipeServiceSpecE:0x00007fb444041040] _serverNamespace = / action = Allow _pipeName =/var/run/vmware/vpxd-webserver-pipe)

  • WebClient がアクセス可能で、ログインしようとすると、以下のようなエラ〜メッセージ "User name and password are required" が表示される。
  • PSCまたはVCSAのいずれかで証明書を置き換えると失敗する。
  • lsdoctortool を使用して Lookup Service から登録を手動で追加/変更/削除できない。
  • 新しい PSC をデプロイしてドメイン間の再ポイントを実行できない。
  • 既存の SSO ドメインにレプリケーション パートナーとして新しい PSC をデプロイできない。
  • Web Clientへのログインが以下のエラーで失敗する:
Cannot connect to vCenter Single Sign-On server https://VC_FQDN/sts/STSService/vsphere.local
もしくは
Cannot connect to vCenter Single Sign-On server https://VC_FQDN:7444/sts/STSService/vsphere.local
もしくは
[400] An error occurred while sending an authentication request to the vCenter Single Sign-On server
  • VCSAを使用したサービスの接続は、次のようなvpxdの認証エラーで失敗します。
2020-10-07T08:27:51.547Z info vpxd[12853] [Originator@6876 sub=vpxCrypt opID=SWI-7203af8f] Failed to read X509 cert; err: 151441516
注:前述のログの引用は単なる例です。日付、時間、および環境変数は、環境によって異なる場合があります。


Environment

VMware vCenter Server 8.0.x
VMware vCenter Server 7.0.x
VMware vCenter Server 8.0
VMware vCenter Server Appliance 6.5.x
VMware vCenter Server Appliance 6.7.x

Cause

これらの問題は、STS (Security Token Service) 証明書の有効期限が切れた場合に発生します。内部サービスとソリューション ユーザーは、有効なトークンを取得できず、想定どおりに操作できません。

注:STS 証明書の有効期限が切れても警告は表示されません。この期限切れは、最初のデプロイから2年経過後直ちに発生し得ます。

STS署名証明書の有効期間が約2年と予想されるシナリオは次のとおりです。
  • 新規インストールする PSC/vCenter Server 6.5 U2 および以降(6.5 製品)
  • 新規インストールした PSC/vCenter Server 6.5 U2 および以降で、6.7, 7.0 と言った以降のバージョンにアップグレードしたもの
  • PSC/vCenter Server インストール後に certtool で STS 証明書を更新したもの
  • STS 署名付き証明書をカスタム証明書に置き換えたもの(内部、外部の CA に関わらず)

Resolution

この問題を解決するには:
  1. このナレッジベース記事 KB に添付された「fixsts.sh」スクリプトをダウンロードし、/tmp フォルダ上の影響を受ける vCenter Server/PSC にアップロードします。または、VI を使用して、そのコンテンツをアプライアンス上のテキスト ファイルにコピーします。
  2. コマンド cd を実行し、/tmp フォルダを開きます。
  3. chmod +x fixsts.sh を実行してファイルを実行可能にします。
  4. ./fixsts.sh を実行します。
  5. SSO ドメイン内のすべての vCenter Server または PSC でサービスを以下のコマンドで再起動します。
    • service-control --stop --all
    • service-control --start --all

    注: マシン SSL 証明書やソリューションユーザと言った他の証明書も期限切れになっている場合にはサービスの再起動が失敗します。その場合、どの証明書が期限切れになっているか特定し、その期限切れになった証明書を置き換える次のステップに進んでください。
  6. Certificate Manager を使用し、有効期限が切れているその他の証明書を How to use vSphere Certificate Manager to Replace SSL Certificates の記載に従って置き換えます。
    • 次のワンライナーを使用すると、vCenter Server Appliance の有効期限の切れたその他の証明書を確認できます。
for i in $(/usr/lib/vmware-vmafd/bin/vecs-cli store list); do echo STORE $i; /usr/lib/vmware-vmafd/bin/vecs-cli entry list --store $i --text | egrep "Alias|Not After"; done
 
マシン SSL 証明書や VMCA ルート証明書を置き換えた場合、NSX, SRM vSphere Replication などのソリューションを再登録する必要があります。
注:ゲートウェイなしで HLM(ハイブリッド リンク モード)を使用している場合は、この手順を実行した後で証明書をクラウドからオンプレミスに再同期する必要があります。

このスクリプトでは SSO 管理者パスワードの要求後、STS 証明書の再生成と置き換えに進みます。

以下は成功した出力の例です。

注:This works on external and embedded PSCs
This script will do the following
1: Regenerate STS certificate
What is needed?
1: Offline snapshots of VCs/PSCs
2: SSO Admin Password
IMPORTANT: This script should only be run on a single PSC per SSO domain
==================================
Resetting STS certificate for vcsa1.gsslabs.org started on Fri May 22 14:39:40 UTC 2020


Detected DN: cn=vcsa1.gsslabs.org,ou=Domain Controllers,dc=vsphere,dc=local
Detected PNID: vcsa1.gsslabs.org
Detected PSC: vcsa1.gsslabs.org
Detected SSO domain name: vsphere.local
Detected Machine ID: ce510c87-35e6-444e-82f0-60a7527608a3
Detected IP Address: 192.168.0.51
Domain CN: dc=vsphere,dc=local
==================================
==================================

Detected Root's certificate expiration date: 2030 May 16
Detected today's date: 2020 May 22
==================================

Exporting and generating STS certificate

Status : Success
Using config file : /tmp/vmware-fixsts/certool.cfg
Status : Success


Enter password for [email protected]:
Amount of tenant credentials: 1
Exporting tenant and trustedcertchain 1 to /tmp/vmware-fixsts

Deleting tenant and trustedcertchain 1


Applying newly generated STS certificate to SSO domain
adding new entry "cn=TenantCredential-1,cn=vsphere.local,cn=Tenants,cn=IdentityManager,cn=Services,dc=vsphere,dc=local"

adding new entry "cn=TrustedCertChain-1,cn=TrustedCertificateChains,cn=vsphere.local,cn=Tenants,cn=IdentityManager,cn=Services,dc=vsphere,dc=local"


Replacement finished - Please restart services on all vCenters and PSCs in your SSO domain
==================================
IMPORTANT: In case you're using HLM (Hybrid Linked Mode) without a gateway, you would need to re-sync the certs from Cloud to On-Prem after following this procedure
==================================
==================================


注:スクリプトを実行すると、次のエラーが表示されることがあります。
bash: ./recreate_machine.sh: /bin/bash^M: bad interpreter: No such file or directory
このエラーは、Windows ベースのテキスト エディタからコピーするときにスクリプトに追加される DOS のキャリッジ リターンが原因で発生します。この問題を解決するには、次のコマンドを実行してスクリプトを再実行します。

sed -i -e 's/\r$//' fixsts.sh

注:
vSphere 5.xまたは6.0からアップグレードした場合、TenantCredentialsに複数のSTSチェーン(trustedcertchain)が存在する可能性があります。 他のチェーンを発行したノードにアクセスできなくなると、認証エラーが発生する可能性があります。

スクリプトを実行すると、古いSTSチェーンがすべて削除され、単一の新しいチェーンに置き換えられ、廃止されたチェーンによって引き起こされた認証エラーが解決されます。


Additional Information



Impact/Risks:
警告:このスクリプトは VMDIR のデータベースと通信します。
スクリプトを実行する前に、SSO ドメイン内のすべての vCenter Server および Platform Service Controller のオフライン スナップショットを同時に作成します。

注:
このスクリプトは、SSO ドメインごとに 1 回のみ実行してください。
サイトにHorizonViewを設定している場合は、「Connection Server unable to accept vCenter thumbprint with an error "There was an error identifying the validity of the server" (67701)」 を参照して下さい。