자동화 시에는 초기 차단 API 호출은 물론 반환된 장기 실행 작업을 폴링할 때에도 오류를 확인해야 합니다. 장기 실행 작업이 오류 없이 완료로 표시된 경우에만 업데이트가 성공한 것으로 간주할 수 있습니다.
UpdateLdapsSettings가 INVALID_ARGUMENT 코드와 함께 오류를 반환할 경우 오류 메시지를 통해 업로드된 인증서에서 무엇이 잘못되었는지 확인할 수 있습니다. 이 오류는 일반적으로 API에 대한 초기 차단 호출 중에 반환됩니다. 이러한 경우에는 재시도해도 효과가 없고 자동화하면 알림이 전송됩니다.
API에서 UNAVAILABLE과 같이 재시도 가능한 다른 오류 코드가 반환되면 적합한 백오프를 사용하여 자동화 작업이 호출을 재시도합니다. 이러한 오류는 일반적으로 UpdateLdapsSettings에 대해 초기 차단 호출로 반환되는 장기 실행 작업을 폴링할 때 반환됩니다.
UpdateLdapsSettings를 호출할 때는 LDAPSSettings가 기대를 충족하고 올바른 상태(ACTIVE)에 있는지 확인하는 것이 좋습니다. GetLdapsSettings를 호출하여 의도된 상태의 인증서 지문을 배포된 인증서 지문과 비교할 수 있습니다. OpenSSL과 같은 도구를 사용하여 새 인증서의 지문을 계산할 수 있습니다.
자동화가 지문을 계산하는 데 사용되는 방법과 관리형 Microsoft AD가 이를 저장하는 방법 사이의 표시 차이점에 유의하십시오.
예를 들어 관리형 Microsoft AD는 지문을 구분되지 않은 단일 16진수 문자열(예: 771B8FD90806E074A7AD49B1624D2761137557D2)로 저장합니다. OpenSSL은 동일한 인증서에 대해 SHA1 Fingerprint=77:1B:8F:D9:08:06:E0:74:A7:AD:49:B1:62:4D:27:61:13:75:57:D2를 반환합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Best practices for automating certificate renewal\n\nThis topic describes the best practices for automating certificate renewal for\nLDAPS.\n\nOverview\n--------\n\nIf you are issuing shorter-lived certificates, we recommend that you automate\nthe renewal of these certificates.\n\nDealing with API errors\n-----------------------\n\nAutomation should check for errors both on the initial blocking API call as\nwell as when polling the returned long-running operation. The update can only be\nconsidered as successful if the long-running operation is marked as done without\nerror.\n\nIf `UpdateLdapsSettings` returns an error with code `INVALID_ARGUMENT`, the\nerror message can explain what is wrong with the uploaded certificate. This\nerror is typically returned during the initial blocking call to the API. In such\ncases, retries are ineffective and the automation should send an alert.\n\nIf the API returns any other error code which is retriable (such as\n`UNAVAILABLE`), the automation should retry the call with the appropriate\nbackoff. These errors are typically returned when polling the long-running\noperation that is returned by the initial blocking call to\n`UpdateLdapsSettings`.\n\nLearn more about\n[`UpdateLdapsSettings`](../reference/rest/v1/projects.locations.global.domains/updateLdapssettings).\n\nChecking the `LDAPSSettings` state\n----------------------------------\n\nAfter calling `UpdateLdapsSettings`, it is good practice to check that\n`LDAPSSettings` meets expectations and is in a good state (`ACTIVE`). You can\ncall `GetLdapsSettings` to compare the fingerprints of certificates in the\nintended state against the deployed certificate fingerprints. You can use tools\nlike OpenSSL to calculate the fingerprints of your new certificates.\n\nDo take note of any display differences between the method the automation uses\nto compute fingerprints versus how Managed Microsoft AD stores them.\nFor example, Managed Microsoft AD stores a thumbprint as a single undelimited\nhexadecimal string: `771B8FD90806E074A7AD49B1624D2761137557D2`. OpenSSL returns\nthe following for the same certificate:\n`SHA1 Fingerprint=77:1B:8F:D9:08:06:E0:74:A7:AD:49:B1:62:4D:27:61:13:75:57:D2`.\n\nLearn more about [`LDAPSSettings`](../reference/rest/v1/LDAPSSettings) and\n[`GetLdapsSettings`](../reference/rest/v1/projects.locations.global.domains/getLdapssettings).\n\nBuilding a PFX certificate chain\n--------------------------------\n\nIf your automation procures certificates in the PEM or CRT formats, you must\nconvert them to PFX and include the entire certificate chain.\n\nTo convert to PFX and include the entire chain, complete the following steps\nusing shell and OpenSSL.\n\n1. Create a single PEM file that includes all intermediate certificates as well\n as the root certificate.\n\n ```\n cat root-ca-cert.pem \u003e\u003e temp.pem\n echo -e \"\\n\" \u003e\u003e temp.pem\n cat intermediate-ca-cert.pem \u003e\u003e temp.pem\n ```\n2. Build the output PFX file. `leaf.key` is the private key.\n\n ```\n openssl pkcs12 -export -out out.pfx -inkey leaf.key -in leaf-cert.pem \\\n -certfile temp.pem -passout \"EXPORT_PASSWORD\"\n ```\n3. Show info of the PFX file. This should show the entire root to leaf chain\n and the private key.\n\n ```\n openssl pkcs12 -in out.pfx -nodes -passin \"EXPORT_PASSWORD\"\n ```"]]