Commit 18a2517
committed
Add --base-domain-overwrite option to container image signing functions
Dear OCI Team,
When attempting to sign images using OCI CLI, the request times out as the URL returned by OCI CLI is incorrect. The correct URL is https://<redacted>-crypto.kms.me-riyadh-1.oci.oraclecloud.com but the one the OCI CLI attempts to use is https://<redacted>-crypto.kms.me-riyadh-1.oraclecloud.com without ".oci." - as a result the image signing fails.
The command that is used to sign images with full administrative permissions is as follows:
```
oci artifacts container image-signature sign-upload --compartment-id ocid1.compartment.oc1...<redacted> --image-id ocid1.containerimage.oc1.me-riyadh-1.0.<redacted> --kms-key-id ocid1.key.oc1.me-riyadh-1.<redacted> --kms-key-version-id ocid1.keyversion.oc1.me-riyadh-1.<redacted> --signing-algorithm SHA_<redacted>_RSA_PKCS_PSS --debug
```
The error that is returned is as follows:
File "<redacted>/site-packages/oci/base_client.py", line 694, in request raise exceptions.RequestException(e) oci.exceptions.RequestException: (MaxRetryError("OCIConnectionPool(host='<redacted>-crypto.kms.me-riyadh-1.oraclecloud.com', port=443): Max retries exceeded with url: /<redacted>/sign (Caused by NewConnectionError('< oci.base_client.OCIConnection object at 0x1123f34d0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))"), 'Request Endpoint: POST https://<redacted>-crypto.kms.me-riyadh-1.oraclecloud.com/<redacted>/sign See https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdk_troubleshooting.htm for help troubleshooting this error, or contact support and provide this full error message.')
After further investigation and chat with kind OCI Support team, it became apparent that this issue is related to a change of endpoint format and may affect multiple regions including me-riyadh-1. The following is from comments in this repository:
Please, accept this PR which will allow flexibility for overwriting the Cryptographic Endpoint to 'oraclecloud.com' or 'oci.oraclecloud.com' or 'oracleiaas.com' etc. as below:
```
oci artifacts container image-signature sign-upload .... --base-domain-overwrite oci.oraclecloud.com
```1 parent 8aa0345 commit 18a2517
File tree
1 file changed
+13
-7
lines changed- services/artifacts/src/oci_cli_artifacts
1 file changed
+13
-7
lines changedLines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
559 | 560 | | |
560 | 561 | | |
561 | 562 | | |
| 563 | + | |
562 | 564 | | |
563 | 565 | | |
564 | 566 | | |
| |||
567 | 569 | | |
568 | 570 | | |
569 | 571 | | |
570 | | - | |
| 572 | + | |
571 | 573 | | |
572 | 574 | | |
573 | 575 | | |
| |||
583 | 585 | | |
584 | 586 | | |
585 | 587 | | |
| 588 | + | |
586 | 589 | | |
587 | 590 | | |
588 | 591 | | |
| |||
607 | 610 | | |
608 | 611 | | |
609 | 612 | | |
610 | | - | |
| 613 | + | |
611 | 614 | | |
612 | 615 | | |
613 | 616 | | |
| |||
741 | 744 | | |
742 | 745 | | |
743 | 746 | | |
744 | | - | |
| 747 | + | |
745 | 748 | | |
746 | 749 | | |
747 | 750 | | |
748 | 751 | | |
749 | | - | |
750 | | - | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
751 | 757 | | |
752 | 758 | | |
753 | 759 | | |
| |||
788 | 794 | | |
789 | 795 | | |
790 | 796 | | |
791 | | - | |
| 797 | + | |
792 | 798 | | |
793 | 799 | | |
794 | | - | |
| 800 | + | |
795 | 801 | | |
796 | 802 | | |
797 | 803 | | |
| |||
0 commit comments