Server IP : 80.241.246.6 / Your IP : 216.73.216.129 Web Server : Apache/2.4.25 (Debian) System : Linux kharagauli 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64 User : www-data ( 33) PHP Version : 7.0.33-0+deb9u12 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/thread-self/root/usr/local/letsencrypt/tools/ |
Upload File : |
""" Given an ACME account key as input, deactivate the account. This can be useful if you created an account with a non-Certbot client and now want to deactivate it. Private key should be in PKCS#8 PEM form. To provide the URL for the ACME server you want to use, set it in the $DIRECTORY environment variable, e.g.: DIRECTORY=https://acme-staging.api.letsencrypt.org/directory python \ deactivate.py private_key.pem """ import os import sys from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization import josepy as jose from acme import client as acme_client from acme import errors as acme_errors from acme import messages DIRECTORY = os.getenv('DIRECTORY', 'http://localhost:4000/directory') if len(sys.argv) != 2: print("Usage: python deactivate.py private_key.pem") sys.exit(1) data = open(sys.argv[1], "r").read() key = jose.JWKRSA(key=serialization.load_pem_private_key( data, None, default_backend())) net = acme_client.ClientNetwork(key, verify_ssl=False, user_agent="acme account deactivator") client = acme_client.Client(DIRECTORY, key=key, net=net) try: # We expect this to fail and give us a Conflict response with a Location # header pointing at the account's URL. client.register() except acme_errors.ConflictError as e: location = e.location if location is None: raise "Key was not previously registered (but now is)." client.deactivate_registration(messages.RegistrationResource(uri=location))