A method for managing HTTPS certificates
Through API interface and system timing tasks, the issuance, renewal and distribution of certificates is solved, and the problems of low efficiency and high error rate caused by manual intervention in the existing technology are automated, and the certificate management is realized, ensuring timely update of certificates is ensured. and securely distributed.
Patent Information
- Application Number
- CN202111112476.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-23
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-09-23
AI Technical Summary
The existing HTTPS certificate management tools require manual intervention in the issuance and certificate renewal process, which is time-consuming and labor-intensive and error-prone, and the certificate distribution process requires manual copying, which is large and error-prone.
Automatically connect to the server through the API interface for domain name resolution and verification, set system timing tasks to achieve certificate renewal and distribution, and reduce manual intervention. The specific steps include obtaining user data information, generating private keys and CSR files, calling Let's Encrypt API interface for visa and renewal, and automatically synchronizing and distributing certificates through timed tasks.
It realizes the automation of certificate issuance and renewal, improves efficiency, reduces manual errors, ensures that the certificate is automatically visaed when it is about to expire, and avoids inaccessibility of the site caused by certificate expiration.
Smart Images

Figure CN113810501B_ABST
Abstract
Description
Technical Field
[0001] The present invention is applied to the WEB application field, and specifically is a method for managing HTTPS certificates. Background Art
[0002] Let's Encrypt is a non-profit certificate authority (CA) that is provided by the Internet Security Research Group (ISRG) and is supported by mainstream browsers. Let's Encrypt uses the ACME protocol to automatically verify domain name ownership when applying for a certificate, but you still need to manually configure DNS resolution and trigger each step according to the requirements of Let's Encrypt. After completing the visa, you can get the text content of the domain name certificate; because of Let's Encrypt's policy requirements, the maximum validity period of each domain name certificate is 3 months.
[0003] In the operation of issuing new certificates, the existing certificate issuing tools need to manually resolve and verify the DNS ownership at the DNS resolution service provider. This process needs to be repeated multiple times when issuing multiple domain names, which is not only time-consuming and labor-intensive, but also prone to errors. In the operation of certificate renewal, the renewal of domain name certificates and the issuance of new certificates are the same process, but the existing certificate issuing tools do not have the function of judging whether the domain name certificate needs to be renewed. In the certificate distribution stage, the existing certificate issuing tools save the certificate information on the local disk of the certificate server after completing the visa. Distribution to other servers requires manual copying. In a large server environment, copying certificate files is a huge workload and prone to errors. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a method for managing HTTPS certificates in view of the deficiencies in the prior art.
[0005] In order to solve the above technical problems, a method for managing HTTPS certificates of the present invention includes:
[0006] New certificate issuance operation: Use the API interface to connect to the server to resolve and verify the domain name and then issue the certificate;
[0007] Certificate renewal operation: Set up a system scheduled task to renew expired certificates;
[0008] Certificate distribution operation: Set up a system scheduled task to synchronize domain name certificate information and make the certificate effective.
[0009] As a possible option, further, the new certificate issuance operation specifically includes the following steps:
[0010] S101, obtaining user data information;
[0011] S102, parsing the user's data information, and querying to determine whether the database already has the visa information of the data information; if not, continuing to execute step S103; if so, determining whether the visa information period of the data information exceeds the threshold, if not, exiting the certificate issuance process, if exceeded, transferring to the subsequent certificate renewal operation;
[0012] S103, generate and save the corresponding private key information, and create a CSR file with added user data information;
[0013] S104, obtain API interface, read account KEY file and log in to server;
[0014] S105, apply to create a new visa order, and determine whether the order is created successfully. If it fails, exit the visa application. If it succeeds, continue to step S106;
[0015] S106, calling the domain name authentication interface to obtain a random string;
[0016] S107, calling the relevant DNS interface to resolve the domain name according to the requirement;
[0017] S108, loop verification whether the DNS domain name resolution is effective;
[0018] S109, the server verifies whether the DNS of the domain name is valid to verify the ownership of the domain name;
[0019] S110, calling the interface to obtain the final visa text information, saving it to the database, and completing the visa.
[0020] As a possible option, further, the API interfaces obtained in step S104 specifically include: a new visa order interface newOrder, a new account creation interface newAccount, and a certificate revocation interface revokeCert.
[0021] As a possible option, further, the step S105 is specifically as follows: put the domain name that requires a visa into the domains list, organize the POST data and call the newOrder interface through the POST method, and judge whether the order is successfully created through the status code and status text returned by the newOrder interface. If the status code is 201 and the status is not pending or ready, it is judged that the order creation failed; if the status is 403, it is judged that the order creation failed and the visa is exited. If the creation is successful, continue to execute step S106.
[0022] As a possible option, further, the step S106 is specifically as follows: after successfully creating an order through the newOrder interface, obtain the authorizations list and obtain the certificate text interface finalize; loop the authorizations list to obtain a domain name authentication interface authz; request the authz interface, and determine the status of the interface call through the returned status code and status text, wherein, if the status code is not 200, the interface call fails, if the status code is 200 and the status is valid, the domain name has been verified, if the interface call fails or the domain name has been verified, jump to the loop authorizations list to continue the next loop, otherwise continue to execute step S107.
[0023] As a possible option, further, the step S107 is specifically as follows: through the information returned by the authz interface, parse out challengeUrl; domain name domain; TXT value resolved by DNS, and concatenate the domain name that needs to be authenticated; call the domain name resolution deletion function, pass in the dnsrrDomain value, determine the resolution service provider where the domain name is located, call the corresponding SDK to execute deletion, call the domain name resolution addition function, pass in the dnsrrDomain value and TXT value, determine the resolution service provider where the domain name is located, call the corresponding SDK to add domain name resolution, the resolution value is the TXT value, and the resolution type is the TXT type.
[0024] As a possible option, further, step S108 is specifically as follows: python initializes dns.resolver, configures nameserver to 8.8.8.8, loops to verify whether dns resolution is effective, initiates a test every 5 seconds, and performs a total of 60 tests.
[0025] As a possible option, further, the step S110 is specifically as follows: after the domain name is verified, the text information of the CSR file is passed in, the finalize interface is called, the final visa text information is obtained, and saved to domainPubFile; the domainKeyFile text information and domainPubFile text information are encrypted using AES; the MD5 fingerprint information and expiration time information of the domainPubFile are calculated, and the information is saved in the database; all information in the database is obtained, encrypted in JSON format by AES, and stored in the KEYFILE file to complete the visa.
[0026] As a possible option, further, the certificate renewal operation specifically includes the following steps:
[0027] S201, setting a system scheduled task in the renewal service;
[0028] S202, obtaining domain name information that already exists in the database in step S102 and whose visa information period exceeds a threshold, and storing it in a list RenewalList;
[0029] S203, loop through the RenewalList list and call the certificate visa function until all domain name renewals are completed.
[0030] As a possible option, further, the certificate distribution operation specifically includes the following steps:
[0031] S301, setting a scheduled task in the server;
[0032] S302, the certificate update program accesses NGINX to obtain the content of the KEYFILE file and decrypts the KEYFILE text content;
[0033] S303, read the local cache to match KEYFILE, if the domain name certificate does not exist, save the domain name certificate to the specified certificate directory, and update the local cache;
[0034] S304, read the local cache to match KEYFILE, if MD5 has changed, update the local certificate file and local cache;
[0035] S305: Determine whether there is any change in the local cache. If there is any change, restart the WEB container. If not, the certificate distribution is completed.
[0036] The present invention adopts the above technical solution and has the following beneficial effects: the visa and renewal process of the present invention is automated, and no large amount of manual intervention is required, which greatly improves efficiency. The automated distribution of certificates also avoids a large amount of manual login to the business server operation, which increases security. Automatic management of certificates, automatic visa when approaching the expiration time, avoids the loss caused by the inaccessibility of the site due to the expiration of the certificate. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0038] Figure 1 It is a schematic diagram of the principle of the present invention;
[0039] Figure 2 This is a schematic diagram of the visa process in an embodiment of the present invention;
[0040] Figure 3 This is a schematic diagram of the renewal process of an embodiment of the present invention;
[0041] Figure 4 The figure is a schematic diagram of the certificate distribution process according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0043] Example 1
[0044] like Figure 1 As shown, the present invention provides a method for managing HTTPS certificates, which includes:
[0045] New certificate issuance operation: Use the API interface to connect to the server to resolve and verify the domain name and then issue the certificate; specifically includes the following steps:
[0046] S101, obtaining user data information;
[0047] S102, parsing the user's data information, and querying to determine whether the database already has the visa information of the data information; if not, continuing to execute step S103; if so, determining whether the visa information period of the data information exceeds the threshold, if not, exiting the certificate issuance process, if exceeded, transferring to the subsequent certificate renewal operation;
[0048] S103, generate and save the corresponding private key information, and create a CSR file with added user data information;
[0049] S104, obtain API interface, read account KEY file and log in to the server; the API interface obtained in step S104 specifically includes: new visa order interface newOrder, new account creation interface newAccount and certificate revocation interface revokeCert.
[0050] S105, apply to create a new visa order, and determine whether the order is created successfully. If it fails, exit the visa process; if it succeeds, continue to step S106; the specific steps of step S105 are: put the domain name that needs a visa into the domains list, organize the POST data and call the newOrder interface through the POST method, and determine whether the order is created successfully through the status code and status text returned by the newOrder interface. If the status code is 201 and the status is not pending or ready, it is determined that the order creation failed; if the status is 403, it is determined that the order creation failed and exit the visa process. If it is created successfully, continue to step S106.
[0051] S106, calling the domain name authentication interface to obtain a random string; the step S106 is specifically as follows: after successfully creating an order through the newOrder interface, obtain the authorizations list and obtain the interface finalize; loop through the authorizations list to obtain a domain name authentication interface authz; request the authz interface, and determine the status of the interface call through the returned status code and status text, wherein, if the status code is not 200, the interface call fails, if the status code is 200 and the status is valid, the domain name has been verified, if the interface call fails or the domain name has been verified, jump to loop through the authorizations list to continue the next loop, otherwise continue to execute step S107.
[0052] S107, calling the relevant DNS interface to resolve the domain name as required; the step S107 is specifically as follows: through the information returned by the authz interface, parse out challengeUrl; domain name domain; TXT value resolved by DNS, and concatenate the domain name that needs to be authenticated; call the domain name resolution deletion function, pass in the dnsrrDomain value, determine the resolution service provider where the domain name is located, call the corresponding SDK to execute the deletion, call the domain name resolution addition function, pass in the dnsrrDomain value and TXT value, determine the resolution service provider where the domain name is located, call the corresponding SDK to add the domain name resolution, the resolution value is the TXT value, and the resolution type is the TXT type.
[0053] S108, loop verification whether DNS domain name resolution is effective; the step S108 is specifically: python initializes dns.resolver, configures nameserver to 8.8.8.8, loop verification whether DNS resolution is effective, initiates a test every 5 seconds, and a total of 60 tests.
[0054] S109, the server verifies whether the DNS of the domain name is valid to verify the ownership of the domain name;
[0055] S110, call the interface to obtain the final visa text information, save it to the database, and complete the visa. The step S110 is specifically as follows: after the domain name is verified, the text information of the CSR file is passed in, the finalize interface is called, the final visa text information is obtained, and it is saved to domainPubFile; the domainKeyFile text information and domainPubFile text information are encrypted using AES; the MD5 fingerprint information and expiration time information of domainPubFile are calculated, and the information is saved in the database; all the information in the database is obtained, encrypted by AES in JSON format, and stored in the KEYFILE file to complete the visa.
[0056] Certificate renewal operation: Set up a system scheduled task to renew expired certificates;
[0057] The specific steps include:
[0058] S201, setting a system scheduled task in the renewal service;
[0059] S202, obtaining domain name information that already exists in the database in step S102 and whose visa information period exceeds a threshold, and storing it in a list RenewalList;
[0060] S203, loop through the RenewalList list and call the certificate visa function until all domain name renewals are completed.
[0061] Certificate distribution operation: Set up a system scheduled task to synchronize domain name certificate information and make the certificate effective.
[0062] Specifically include:
[0063] S301, setting a scheduled task in the server;
[0064] S302, the certificate update program accesses NGINX to obtain the content of the KEYFILE file and decrypts the KEYFILE text content;
[0065] S303, read the local cache to match KEYFILE, if the domain name certificate does not exist, save the domain name certificate to the specified certificate directory, and update the local cache;
[0066] S304, read the local cache to match KEYFILE, if MD5 has changed, update the local certificate file and local cache;
[0067] S305: Determine whether there is any change in the local cache. If there is any change, restart the WEB container. If not, the certificate distribution is completed.
[0068] Example 2
[0069] like Figure 2 As shown, apply for a visa:
[0070] S1, obtain the domain name INPUTDOMAIN input by the user through the command line.
[0071] S2, add the tldextract extension library in Python to parse the domain name information entered by the user and obtain the subdomain, domain, and suffix information.
[0072] S3, check whether the database already has the visa information of INPUTDOMAIN. If it does exist and the certificate expiration time is less than 20 days, it means that the certificate is valid and exit the process. If it does not exist, continue to execute the following steps.
[0073] S4, add the paramiko extension library to Python, generate 1024-bit or 2048-bit private key information (paramiko.RSAKey.generate(2048)), and save it to domainKeyFile.
[0074] S5. Create a CSR file and add the user input INPUTDOMAIN to the CSR file ('openssl req-new-sha256-key %s-subj" / "-addext"subjectAltName=DNS:*.%s,DNS:%s"-out%s'%(domainKeyFile,singDomain,singDomain,domainCsrFile)).
[0075] S6, get the latest API interface of Let's Encrypt through the interface, and you will get the new visa order interface newOrder, the new account creation interface newAccount, and the certificate revocation interface revokeCert.
[0076] S7, read the Let's Encrypt account KEY file and log in to the Let's Encrypt service. If the account KEY file does not exist, create a new KEY and register a new Let's Encrypt account through the newAccount interface and log in.
[0077] S8, put the domain name that needs a visa into the domains list, organize the POST data ({"identifiers":[{"type":"dns","value":domain}for domain in domains]}) and call the newOrder interface through the POST method.
[0078] S9, judge whether the order is created successfully through the status code and status text returned by the newOrder interface. If the status code is 201 and the status is not pending or ready, it is judged that the order creation failed; if the status is 403, it is judged that the order creation failed. If the creation is successful, continue to execute the following steps.
[0079] S10, after successfully creating an order through the newOrder interface, you will get the authorizations list; the final result acquisition interface is finalize. The authorizations list is the authentication interface for each domain name, for example ['https: / / acme-staging-v02.api.letsencrypt.org / acme / authz-v3 / 481907568','https: / / acme-staging-v02.api.letsencrypt.org / acme / authz-v3 / 481907578'].
[0080] S11, loop through the authorizations list and obtain a domain name authentication interface authz (forauthz in authorizations).
[0081] S12, request the authz interface, and determine the status of the interface call by the returned status code and status text. If the status code is not 200, the interface call fails. If the status code is 200 and the status is valid, the domain name has been verified. If the interface call fails or the domain name has been verified, jump to S11 to continue the next cycle, otherwise continue to execute the following steps.
[0082] S13, through the information returned by the authz interface, parse out challengeUrl (challengeUrl = challenges [0]); domain name domain (authorization ["identifier"]["value"]); DNS parsed TXT value, and splice the domain name that needs to be authenticated (dnsrrDomain = "_acme-challenge. {0}.".format (domain);).
[0083] S14, calling the domain name resolution deletion function, passing in the dnsrrDomain value, determining the resolution service provider of the domain name, and calling the corresponding SDK to perform the deletion. For example, if the domain name resolution service is Alibaba Cloud, then calling the Alibaba Cloud SDK to delete the domain name resolution. If it is Tencent Cloud, then calling the Tencent SDK to delete it.
[0084] S15, calling the domain name resolution adding function, passing in the dnsrrDomain value and TXT value, determining the resolution service provider where the domain name is located, calling the corresponding SDK to add the domain name resolution, the resolution value is the TXT value, and the resolution type is the TXT type.
[0085] S16, python initializes dns.resolver, configures nameserver to 8.8.8.8, and loops to verify whether the DNS resolution is effective. A test is initiated every 5 seconds, for a total of 60 tests.
[0086] S17, after detecting that the DNS resolution is effective, calls challengeUrl to request the Let's Encrypt server to verify whether the DNS of the domain name is valid to verify the ownership of the domain name.
[0087] S18, if the authorizations list has not been executed sequentially, jump to S11 to parse the next cycle until all domain names in the authorizations are verified.
[0088] S19, after all domain names are verified, the text information of the CSR file is passed in, the finalize interface is called, the final visa text information is obtained, and saved to domainPubFile.
[0089] S20, use AES to encrypt the domainKeyFile text information and domainPubFile text information; calculate the MD5 fingerprint information, expiration time and other information of the domainPubFile, and save the information in the database. The visa process is completed.
[0090] S21 obtains all information in the database, encrypts it in JSON format using AES, and stores it in the KEYFILE file. NGINX also provides access to the KEYFILE file.
[0091] like Figure 3 As shown, renew the certificate
[0092] S22, setting a system scheduled task in the renewal service, for example, executing certificate renewal at 1:00 a.m. every day.
[0093] S23, obtaining domain name information whose certificate expiration time is less than 20 days from the database, and storing it in the list RenewalList.
[0094] S24, loops through the RenewalList list, calls the certificate visa function, and executes from S1 until all domain name renewals are completed.
[0095] like Figure 4 As shown, distribute the certificates
[0096] S25, setting a scheduled task in the server, for example, executing certificate update at 2 a.m. every day.
[0097] S26, the certificate update program accesses NGINX to obtain the content of the KEYFILE file and decrypts the KEYFILE text content.
[0098] S27, read the local cache to match KEYFILE, if the domain name certificate does not exist, save the domain name certificate to the specified certificate directory, and update the local cache.
[0099] S28, read the local cache to match KEYFILE, if the MD5 has changed, update the local certificate file and update the local cache.
[0100] S29, determine whether there is any change in the local cache, and restart the WEB container, such as NGINX, TOMCAT, etc. if there is any change. Certificate distribution is completed.
[0101] The following problems existing in the prior art are solved:
[0102] 1. The existing technology calls the Let's Encrypt interface according to the ACME protocol, and needs to determine the next steps according to the interface call situation, and the steps are complicated.
[0103] 2. DNS resolution needs to be configured during the interaction with the Let's Encrypt interface. In this process, you need to log in to a third-party DNS resolution service provider to operate. If there are too many visa domain names, the workload will increase greatly and it is easy to make mistakes. For example, if you visa 100 domain names, you need to frequently resolve and delete the DNS configuration for 100 times.
[0104] 3. Because the global effectiveness of DNS has a delayed feature, it is necessary to constantly check whether the DNS resolution is effective, and call the Let's Encrypt interface to complete subsequent operations based on the effectiveness of DNS. In this process, it is necessary to manually query the effectiveness of the global DNS, which is extremely time-consuming and labor-intensive.
[0105] 4. The domain name certificate text content returned after the visa is completed, in the subsequent certificate management certificate, you need to view the domain name contained in the certificate, certificate expiration time and other operations, all of which require parsing the certificate content to do, which is extremely troublesome and time-consuming.
[0106] 5. After the certificate visa is completed, it is difficult to distribute it, and the certificate needs to be manually copied to different business servers.
[0107] 6. The domain name certificate is valid for 3 months and needs to be renewed frequently, otherwise the site will be inaccessible if the certificate expires.
[0108] The above are embodiments of the present invention. For ordinary technicians in this field, according to the teachings of the present invention, all equivalent changes, modifications, substitutions and variations made within the scope of the patent application of the present invention without departing from the principles and spirit of the present invention should fall within the scope of the present invention.
Claims
1. A method for managing HTTPS certificates, characterized in that: It includes: New certificate issuance operation: Use the API interface to connect to the server to resolve and verify the domain name and then issue the certificate; The specific steps include: S101, obtaining user data information; specifically: obtaining the domain name INPUTDOMAIN input by the user through a command line; S102, parsing the user's data information, and querying and determining whether the visa information of the data information already exists in the database; If not, continue to execute step S103; if it exists, determine whether the visa information period of the data information exceeds the threshold, if not, exit the certificate issuance process, if exceeded, transfer to the subsequent certificate renewal operation; S103, generate and save the corresponding private key information, and create a CSR file with added user data information; S104. Obtain the latest API interface of Let's Encrypt through the interface, obtain the new visa order interface newOrder, the new account creation interface newAccount and the certificate revocation interface revokeCert; read the account KEY file of Let's Encrypt and log in to the server. If the account KEY file does not exist, create a new KEY and register a new Let's Encrypt account through the newAccount interface and log in; S105, apply to create a new visa order, and determine whether the order is created successfully. If it fails, exit the visa process. If it succeeds, continue to step S106; specifically: put the domain name that needs a visa into the domains list, organize POST data and call the newOrder interface through the POST method, and determine whether the order is created successfully through the status code and status text returned by the newOrder interface. If the status code is 201 and the status is not pending or ready, it is determined that the order creation failed; if the status is 403, it is determined that the order creation failed and exit the visa process. If it is created successfully, continue to step S106; S106, calling the domain name authentication interface to obtain a random string; S107, calling the relevant DNS interface to resolve the domain name according to the requirement; S108, loop verification whether the DNS domain name resolution is effective; S109, the server verifies whether the DNS of the domain name is valid to verify the ownership of the domain name; S110, calling the interface to obtain the final visa text information, saving it to the database, and completing the visa; Certificate renewal operation: Set up a system scheduled task to renew expired certificates; Certificate distribution operation: Set up a system scheduled task to synchronize domain name certificate information and make the certificate effective.
2. The method for managing HTTPS certificates according to claim 1, characterized in that: The step S106 specifically includes: after successfully creating an order through the newOrder interface, obtaining the authorizations list, obtaining the interface finalize; looping through the authorizations list, obtaining a domain name authentication interface authz therein; Request the authz interface and determine the status of the interface call by the returned status code and status text. If the status code is not 200, the interface call fails. If the status code is 200 and the status is valid, the domain name has been verified. If the interface call fails or the domain name has been verified, jump to the loop authorizations list to continue the next loop. Otherwise, continue to step S107.
3. A method for managing HTTPS certificates according to claim 2, characterized in that: The step S107 specifically includes: parsing the challengeUrl, the domain name domain and the TXT value resolved by the DNS through the information returned by the authz interface, and concatenating the domain name that needs to be authenticated; Call the domain name resolution deletion function, pass in the dnsrrDomain value, determine the resolution service provider where the domain name is located, call the corresponding SDK to execute the deletion, call the domain name resolution addition function, pass in the dnsrrDomain value and TXT value, determine the resolution service provider where the domain name is located, call the corresponding SDK to add the domain name resolution, the resolution value is the TXT value, and the resolution type is the TXT type.
4. The method for managing HTTPS certificates according to claim 3, characterized in that: The step S108 is specifically as follows: python initializes dns.resolver, configures nameserver to 8.8.8.8, and cyclically verifies whether the dns resolution is effective, initiating a test every 5 seconds, for a total of 60 times.
5. The method for managing HTTPS certificates according to claim 4, characterized in that: The step S110 specifically includes: after the domain name is verified, the text information of the CSR file is passed in, the finalize interface is called, the final visa text information is obtained, and saved to domainPubFile; domainKeyFile text information and domainPubFile text information are encrypted using AES; Calculate the MD5 fingerprint information and expiration time information of domainPubFile, and save the information in the database; Get all the information in the database, encrypt it in JSON format through AES and store it in the KEYFILE file to complete the visa.
6. A method for managing HTTPS certificates according to claim 5, characterized in that: The certificate renewal operation specifically includes the following steps: S201, setting a system scheduled task in the renewal service; S202, obtaining domain name information that already exists in the database in step S102 and whose visa information period exceeds a threshold, and storing it in a list RenewalList; S203, loop through the RenewalList list and call the certificate visa function until all domain name renewals are completed.
7. A method for managing HTTPS certificates according to claim 6, characterized in that: The certificate distribution operation specifically includes the following steps: S301, setting a scheduled task in the server; S302, the certificate update program accesses NGINX to obtain the content of the KEYFILE file and decrypts the KEYFILE text content; S303, read the local cache to match KEYFILE, if the domain name certificate does not exist, save the domain name certificate to the specified certificate directory, and update the local cache; S304, read the local cache to match KEYFILE, if MD5 has changed, update the local certificate file and local cache; S305: Determine whether there is any change in the local cache. If there is any change, restart the WEB container. If not, the certificate distribution is completed.
