This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
docpublic:systemes:acme_auto [2021/11/04 21:35] adminjp [ACME] |
docpublic:systemes:acme_auto [2021/12/27 21:17] (current) adminjp [clé DDNS API gandi] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== ACME ==== | + | ===== ACME DNS-01 |
+ | Demonstration de l' | ||
==== acme.sh ==== | ==== acme.sh ==== | ||
+ | |||
+ | installation | ||
+ | |||
+ | * https:// | ||
< | < | ||
Line 27: | Line 31: | ||
À ce stade, le client est installé dans / | À ce stade, le client est installé dans / | ||
+ | |||
+ | |||
+ | ==== clé DDNS API gandi ==== | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | Générer une clé API sur https:// | ||
+ | |||
+ | [root@vps ~]# export GANDI_LIVEDNS_KEY=" | ||
+ | |||
+ | ==== passage en LiveDNS Gandi ==== | ||
+ | |||
+ | si le domaine est ancien, il est probablemnt sur les anciens serveur de noms gandi (non dynamiques) : | ||
+ | - a.dns.gandi.net | ||
+ | - b.dns.gandi.net | ||
+ | - c.dns.gandi.net | ||
+ | |||
+ | passage en dynamique : | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== register email ==== | ||
+ | |||
+ | < | ||
+ | [root@vps ~]# ~/ | ||
+ | [jeu. nov. 4 22:45:12 CET 2021] No EAB credentials found for ZeroSSL, let's get one | ||
+ | [jeu. nov. 4 22:45:13 CET 2021] Registering account: https:// | ||
+ | [jeu. nov. 4 22:45:14 CET 2021] Registered | ||
+ | [jeu. nov. 4 22:45:14 CET 2021] ACCOUNT_THUMBPRINT=' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== packages curl et jq ==== | ||
+ | |||
+ | pour lancer les requetes web en cli et parser du json nous avons besoin de ces 2 packages | ||
+ | |||
+ | < | ||
+ | [root@vps ~]# yum install curl jq | ||
+ | </ | ||
+ | |||
+ | ==== parametres API Gandi ==== | ||
+ | |||
+ | On postionne les vrariables shell necessaires à l' | ||
+ | |||
+ | < | ||
+ | #recuperer notre adresse IP depuis les servers Akamai | ||
+ | MY_IP=$(curl -s http:// | ||
+ | |||
+ | # Gandi livedn API KEY | ||
+ | APIKEY=" | ||
+ | |||
+ | # Domain static hebergé chez Gandi | ||
+ | DOMAIN=" | ||
+ | |||
+ | # Dynamic Subdomain | ||
+ | SUBDOMAIN=" | ||
+ | |||
+ | #Get the current Zone for the provided domain | ||
+ | CURRENT_ZONE_HREF=$(curl -s -H " | ||
+ | |||
+ | # Update the A reccord of the Dynamic Subdomain by PUTing on the current zone | ||
+ | curl -D- -X PUT -H " | ||
+ | -H " | ||
+ | -d " | ||
+ | | ||
+ | | ||
+ | | ||
+ | $CURRENT_ZONE_HREF/ | ||
+ | </ | ||
+ | |||
+ | ==== exemple d' | ||
+ | |||
+ | exemple complet d' | ||
+ | |||
+ | < | ||
+ | [root@vps ~]# ~/ | ||
+ | [lun. nov. 8 22:05:41 CET 2021] Using CA: https:// | ||
+ | [lun. nov. 8 22:05:41 CET 2021] Single domain=' | ||
+ | [lun. nov. 8 22:05:41 CET 2021] Getting domain auth token for each domain | ||
+ | [lun. nov. 8 22:05:44 CET 2021] Getting webroot for domain=' | ||
+ | [lun. nov. 8 22:05:44 CET 2021] Adding txt value: 2ulRNvSECRET-bd0ySECRETurebtXp4EQHjQ2I_Oc for domain: | ||
+ | [lun. nov. 8 22:05:47 CET 2021] Adding record success | ||
+ | [lun. nov. 8 22:05:47 CET 2021] The txt record is added: Success. | ||
+ | [lun. nov. 8 22:05:47 CET 2021] Let's check each DNS record now. Sleep 20 seconds first. | ||
+ | [lun. nov. 8 22:06:08 CET 2021] You can use ' | ||
+ | [lun. nov. 8 22:06:08 CET 2021] See: https:// | ||
+ | [lun. nov. 8 22:06:08 CET 2021] Checking wp.mondomain.fr for _acme-challenge.wp.mondomain.fr | ||
+ | [lun. nov. 8 22:06:08 CET 2021] Domain wp.mondomain.fr ' | ||
+ | [lun. nov. 8 22:06:08 CET 2021] All success, let's return | ||
+ | [lun. nov. 8 22:06:08 CET 2021] Verifying: wp.mondomain.fr | ||
+ | [lun. nov. 8 22:06:09 CET 2021] Processing, The CA is processing your order, please just wait. (1/30) | ||
+ | [lun. nov. 8 22:06:12 CET 2021] Success | ||
+ | [lun. nov. 8 22:06:12 CET 2021] Removing DNS records. | ||
+ | [lun. nov. 8 22:06:12 CET 2021] Removing txt: 2ulRNvSECRET-bd0ySECRETurebtXp4EQHjQ2I_Oc for domain: _acme-challenge.wp.domain.fr | ||
+ | [lun. nov. 8 22:06:13 CET 2021] Removing record success | ||
+ | [lun. nov. 8 22:06:13 CET 2021] Removed: Success | ||
+ | [lun. nov. 8 22:06:13 CET 2021] Verify finished, start to sign. | ||
+ | [lun. nov. 8 22:06:13 CET 2021] Lets finalize the order. | ||
+ | [lun. nov. 8 22:06:13 CET 2021] Le_OrderFinalize=' | ||
+ | [lun. nov. 8 22:06:14 CET 2021] Order status is processing, lets sleep and retry. | ||
+ | [lun. nov. 8 22:06:14 CET 2021] Retry after: 15 | ||
+ | [lun. nov. 8 22:06:30 CET 2021] Polling order status: https:// | ||
+ | [lun. nov. 8 22:06:31 CET 2021] Downloading cert. | ||
+ | [lun. nov. 8 22:06:31 CET 2021] Le_LinkCert=' | ||
+ | [lun. nov. 8 22:06:32 CET 2021] Cert success. | ||
+ | -----BEGIN CERTIFICATE----- | ||
+ | MIIGbjCCBFagAwIBAgIQXCJ7bhctS2// | ||
+ | MQswCQYDVQQGEwJBVDEQMA4GA1UEChMHWmVyb1NTTDEqMCgGA1UEAxMhWmVyb1NT | ||
+ | TCBSU0EgRG9tYWluIFNlY3VyZSBTaXRlIENBMB4XDTIxMTEwODAwMDAwMFoXDTIy | ||
+ | MDIwNjIzNTk1OVowGzEZMBcGA1UEAxMQZHdwLmFkYXZvY2F0cy5mcjCCASIwDQYJ | ||
+ | KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMFs/ | ||
+ | 2hBbZelSxne8KsvRa5PJEzDWU4FqBwm0Taw5qjqc038Zjx3RY7u6hPsbNiEhEHI8 | ||
+ | .... | ||
+ | ZXekr3ynlDwTnwUU3YH5+puEorNDxX8X+wl9l3rAMS3AsVpwm4YgFVLgcWTwoq7Q | ||
+ | mxpL5qTsrSmrn7iaAqFr+3v0GBFLley2j6FHaQnPuvMoVmPK0hliJGGkAer2HZab | ||
+ | cYkq9EZdfAswZX5UYTLNBHcYX0eqYM1ZDFpIF69piusa1rS0BPWaTTo+rIvkiefO | ||
+ | DYRjQRD0hnFd34oTW7J/ | ||
+ | xETgUMXEPkdtUPmM4AJvQYXk | ||
+ | -----END CERTIFICATE----- | ||
+ | [lun. nov. 8 22:06:32 CET 2021] Your cert is in: / | ||
+ | [lun. nov. 8 22:06:32 CET 2021] Your cert key is in: / | ||
+ | [lun. nov. 8 22:06:32 CET 2021] The intermediate CA cert is in: / | ||
+ | [lun. nov. 8 22:06:32 CET 2021] And the full chain certs is there: / | ||
+ | </ | ||
+ | |||
==== references ==== | ==== references ==== | ||
* https:// | * https:// | ||
+ | * https:// | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
+ | * https:// | ||
* https:// | * https:// | ||