Digital certificate acquisition method, device, electronic device, system and storage medium
By using the SDK in the proxy server to automatically query and update the digital certificate status, it solves the problem of cumbersome manual operations for users when the digital certificate is invalid in HTTPS, realizes automatic acquisition and update of certificates, and improves user experience and convenience.
Patent Information
- Application Number
- CN202111413394.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-11-25
AI Technical Summary
In the HTTPS protocol, when the digital certificate is invalid, the user needs to manually apply for and download the latest version of the certificate, which is cumbersome and brings inconvenience to the user.
By installing the preset SDK in the proxy server, the digital certificate of the target business server is automatically loaded, its status is queried, and when invalid, a new digital certificate is automatically downloaded and sent to the terminal to realize the communication connection between the terminal and the target business server.
It simplifies user operations, realizes automatic acquisition and update of digital certificates, reduces user participation, improves convenience, and supports automatic certificate acquisition services for multiple terminals.
Smart Images

Figure CN114157432B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to network security technology, and in particular to a method, device, electronic device, system and storage medium for obtaining a digital certificate. Background Art
[0002] Hyper Text Transfer Protocol over Secure Socket Layer (HTTPS) is a network protocol that can perform encrypted transmission and identity authentication, which can prevent data from being stolen or changed during transmission and ensure the integrity of the data. As network security issues are becoming more and more important, the use of HTTPS is becoming more and more common. During the use of HTTPS, a digital certificate needs to be provided to the terminal to ensure communication security, but the digital certificate may be invalid for various reasons. In the prior art, when the digital certificate is invalid, the user is often required to manually apply for and download the latest version of the digital certificate at the terminal, which is cumbersome and inconvenient for the user. Summary of the invention
[0003] The embodiments of the present invention provide a method, device, electronic device, system and storage medium for obtaining a digital certificate, which can simplify user operations and bring convenience to users.
[0004] In a first aspect, an embodiment of the present invention provides a method for obtaining a digital certificate, which is applied to a proxy server (such as Nginx), wherein a preset software development kit (SDK) is installed in the proxy server, and the method comprises:
[0005] Loading a first digital certificate of a target service server and obtaining identification information of the first digital certificate;
[0006] Calling a preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate;
[0007] When the status of the first digital certificate is invalid, calling the preset SDK to download the second digital certificate of the target service server;
[0008] The second digital certificate is sent to the terminal, so that the terminal establishes a communication connection with the target service server based on the second digital certificate.
[0009] In a second aspect, an embodiment of the present invention further provides a digital certificate acquisition device, which is applied to a proxy server, wherein a preset software development kit SDK is installed in the proxy server, and the device comprises:
[0010] An acquisition module, used to load a first digital certificate of a target service server and acquire identification information of the first digital certificate;
[0011] A query module, used for calling a preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate;
[0012] A download module, used for calling the preset SDK to download the second digital certificate of the target service server when the status of the first digital certificate is invalid;
[0013] The sending module is used to send the second digital certificate to the terminal, so that the terminal establishes a communication connection with the target service server based on the second digital certificate.
[0014] In the third aspect, an embodiment of the present invention also provides a digital certificate acquisition system, including a terminal, an Online Certificate Status Protocol (OCSP) server, a Certificate Authority CA (CA) server, a target business server, and a proxy server for executing the digital certificate acquisition method as described in any one of the embodiments of the present invention.
[0015] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for obtaining a digital certificate as described in any one of the embodiments of the present invention.
[0016] In the embodiment of the present invention, a preset SDK is installed in the proxy server. After loading the first digital certificate of the target business server and obtaining the identification information of the first digital certificate, the proxy server will call the preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate; when the status of the first digital certificate is invalid, call the preset SDK to download the second digital certificate of the target business server; send the second digital certificate to the terminal, so that the terminal establishes a communication connection with the target business server based on the second digital certificate. That is, in the embodiment of the present invention, the proxy server can use the preset SDK to automatically query the status of the digital certificate, and when the digital certificate is invalid, automatically download a new digital certificate and feed back the new digital certificate to the terminal, so that the terminal establishes a communication connection with the target business server based on the new digital certificate. The entire digital certificate acquisition process is automatically implemented by the SDK in the proxy server, and does not require user participation, which brings convenience to users.
[0017] In addition, since the proxy server has an SDK for confirming and obtaining the status of digital certificates, the proxy server can communicate with a variety of terminals, thereby providing automatic certificate acquisition services for a variety of terminals, with a wide range of application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The present invention is a flowchart of a method for obtaining a digital certificate according to an embodiment of the present invention.
[0019] Figure 2 This is another flowchart of the method for obtaining a digital certificate provided by an embodiment of the present invention.
[0020] Figure 3 It is a structural schematic diagram of a digital certificate acquisition device provided in an embodiment of the present invention.
[0021] Figure 4 It is a structural diagram of a digital certificate acquisition system provided by an embodiment of the present invention.
[0022] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0024] Figure 1 The present invention provides a flowchart of a method for obtaining a digital certificate. This embodiment is applicable to the case where a proxy server automatically downloads the latest version of a digital certificate for a terminal when a digital certificate expires. The method can be executed by a digital certificate obtaining device, which can be implemented in hardware and / or software. In a specific embodiment, the device can be integrated in a proxy server, which can be Nginx. The following embodiments will be described by taking the device integrated in a proxy server as an example. Figure 1 As shown, the method may specifically include the following steps:
[0025] Step 101: Load the first digital certificate of the target service server and obtain identification information of the first digital certificate.
[0026] The business server may be a server that provides various business data to terminal users, such as a page server, an application server, etc. The business data may be, for example, a web page, a picture, a table, etc., which are not specifically limited here. The target business server may be a business server that the current terminal requests to access. Specifically, the proxy server may call a preset SDK to download the first digital certificate of each business server from a certificate authority CA server, wherein each business server includes the target business server.
[0027] For example, the preset SDK can be pre-configured in the proxy server, and the proxy server can call the preset SDK to access the public key infrastructure (PKI) to download the digital certificates of each business server. The basic technologies of PKI include: public key encryption, digital signature, data integrity mechanism, digital envelope (hybrid encryption) and double digital signature and other technologies. The functions that PKI can achieve include identity authentication, data integrity, data confidentiality, non-repudiation of operations and other functions.
[0028] The CA server is the core of PKI. The functions that the CA server can implement include processing digital certificate applications, issuing digital certificates, updating digital certificates, accepting end-user digital certificate inquiries, revoking certificates, publishing digital certificate revocation lists (CRLs), and archiving digital certificates.
[0029] For example, the proxy server calls the preset SDK to access the PKI service and sends a request to load the keystore. The keystore is a file that is stored in the keytool. The keytool is a digital certificate management tool. The keytool stores the key and certificate in a file named keystore. The keystore file includes the key or private key and the paired public key (using asymmetric encryption) and the trusted certificate entity. Downloading the digital certificate of each business server by calling the preset SDK specifically includes the following steps:
[0030] 1) Call the preset SDK to send a request to the PKI service to download the keystore. After the PKI service receives the request, the keytool can generate a self-signed CA digital certificate, which can be used to sign the digital certificates of the terminal and the business server, and generate a pair of keys (with a self-signed CA digital certificate) for the business server and store them in a folder. The keytool requests the CA server to sign the self-signed digital certificate of the business server and generate a signature request file.
[0031] 2) The proxy server obtains the digital certificate signed by the CA server for the business server, and exports the obtained digital certificate and stores it in a local folder.
[0032] 3) The proxy server updates the digital certificate of the business server. After the digital certificate is signed by the CA server, the digital certificate of the CA server is also saved in the local folder to form a complete certificate chain.
[0033] Furthermore, the proxy server can obtain the digital certificates of each service server and store the digital certificates. After the proxy server completes loading the keystore, downloading and storing the digital certificates of each service server, the status of the digital certificates can be verified.
[0034] The proxy server can query the status of the first digital certificate by accessing the OCSP protocol in the PKI. The OCSP protocol is a relatively simple request / response protocol. When the proxy server needs to check the status of one or more digital certificates, the proxy server can establish a connection with the OCSP server and generate an OCSP request message, which contains the information required to identify the digital certificate to be queried, such as the certificate serial number, the name of the certificate issuer, the public key information of the certificate issuer, and the encryption algorithm used. In addition, it may also contain some optional items, such as the Nonce value (used to bind a request and a corresponding response), the requester name, the signature of the request, and any other necessary extended information. The proxy server submits the OCSP request information to the OCSP server by calling the preset SDK, and waits for the OCSP server to return a definite response, which includes the status information of the reply certificate. The reply certificate status information can be "normal", "expired" or "revoked". The "normal" status indicates that the certificate has not been revoked and the certificate is valid; the "revoked" status indicates that the certificate has been revoked and the certificate is invalid; the "expired" status indicates that the certificate has expired and the certificate is invalid.
[0035] The proxy server can obtain the address of the OCSP server through the configured SDK, send a certificate status query request to the OCSP server and obtain the status information of the digital certificate. When the digital certificate status is valid, the proxy server stores the digital certificate. When the digital certificate status is invalid, the proxy server can reload the keystore to download the digital certificate.
[0036] Furthermore, the proxy server stores the downloaded digital certificate of the business server, and calls the preset SDK to load the first digital certificate of the target business server from the stored digital certificate of the business server. Specifically, the first digital certificate may include information such as the certificate serial number, certificate name, certificate expiration time, site organization name, site domain name system (Domain Name System, DNS) host name, site public key, certificate issuer name, and certificate signature. The identification information of the first digital certificate may be information such as the certificate serial number of the first digital certificate or the name of the first digital certificate.
[0037] Step 102: calling a preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate.
[0038] For example, the preset SDK can be pre-configured in the proxy server, and the terminal can call the preset SDK through the proxy server to query the status of the first digital certificate based on the identification information of the first digital certificate. For example, the proxy server can query the status of the first digital certificate by accessing the OCSP protocol in the PKI. The proxy server can establish a connection with the OCSP server, generate an OCSP request message and wait for the OCSP server to return a certain response, which includes the status information of the reply certificate. The reply certificate status information can be "normal", "expired" or "revoked". The "normal" status indicates that the certificate has not been revoked and the certificate is valid; the "revoked" status indicates that the certificate has been revoked and the certificate is invalid; the "expired" status indicates that the certificate has expired and the certificate is invalid. The proxy server can obtain the address of the OCSP server through the configured SDK, send a certificate status query request to the OCSP server and obtain the status information of the first digital certificate. When the status of the first digital certificate is valid, the proxy server sends the first digital certificate to the terminal, so that the terminal establishes a communication connection with the service server based on the first digital certificate.
[0039] Step 103: When the status of the first digital certificate is invalid, call the preset SDK to download the second digital certificate of the target service server.
[0040] After determining the status of the first digital certificate, if the status of the first digital certificate is invalid, the proxy server can call the preset SDK to access the CA server to obtain the second digital certificate, where the version of the second digital certificate can be higher than the version of the first digital certificate. The proxy server can call the preset SDK to send an application request for the second digital certificate to the CA server. After the CA server receives the second digital certificate application and authenticates the user's identity information, it can use the terminal's public key, identity information, validity period of the digital certificate and other information as the original message, and encrypt it with the CA server's private key to form a digital signature. The digital signature and the public key, identity information, validity period of the second digital certificate owner (terminal) and other information together constitute the second digital certificate. The proxy server can download the second digital certificate from the CA server.
[0041] Step 104: Send the second digital certificate to the terminal, so that the terminal establishes a communication connection with the target service server based on the second digital certificate.
[0042] After the proxy server obtains the second digital certificate, the proxy server can further call the preset SDK based on the identification information of the second digital certificate, send a request for querying the status of the second digital certificate to the OCSP server, and query the status of the second digital certificate. When the status of the second digital certificate is valid, the proxy server sends the second digital certificate to the terminal, so that the terminal establishes a communication connection with the business server based on the second digital certificate.
[0043] The technical solution of this embodiment is to load the first digital certificate of the target business server and obtain the identification information of the first digital certificate; call the preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate; when the status of the first digital certificate is invalid, call the preset SDK to download the second digital certificate of the target business server; send the second digital certificate to the terminal, so that the terminal establishes a communication connection with the target business server based on the second digital certificate. That is, in the embodiment of the present invention, the proxy server can use the preset SDK to automatically query the status of the digital certificate, and when the digital certificate is invalid, automatically download the new digital certificate and feed the new digital certificate back to the terminal, so that the terminal establishes a communication connection with the target business server based on the new digital certificate. The entire digital certificate acquisition process is automatically implemented by the SDK in the proxy server, and does not require the user to participate in the operation, which brings convenience to the user.
[0044] The following further describes the method for obtaining a digital certificate provided by an embodiment of the present invention. The specific method can be as follows: Figure 2 As shown, the method may include the following steps:
[0045] Step 201: Call a preset SDK to download and store the first digital certificate of each service server from a certificate authority CA server.
[0046] The preset SDK can be pre-configured in the proxy server, and the proxy server can call the preset SDK to access PKI to download the digital certificates of each business server. After the download is complete, the domain name of each business server and the digital certificate can be stored in correspondence.
[0047] For example, the proxy server can call the preset SDK to access the PKI service to load the keystore. The specific process of downloading the digital certificates of each business server from the CA server by calling the preset SDK is as described in step 101 and will not be repeated here.
[0048] Step 202: Receive an access request sent by a terminal, where the access request includes the domain name of a target service server.
[0049] For example, the terminal may send an access request to the proxy server, the access request including the domain name of the target service server. The proxy server receives the access request sent by the terminal, and parses the access request to obtain the domain name of the target service server.
[0050] Step 203: Load the first digital certificate of the target service server from the stored first digital certificates of each service server based on the domain name.
[0051] For example, the proxy server may query the storage based on the resolved domain name, thereby obtaining the first digital certificate of the target service server.
[0052] Step 204: Obtain identification information of the first digital certificate.
[0053] Specifically, the first digital certificate may include information such as certificate serial number, certificate name, certificate expiration time, site organization name, DNS host name, site public key, certificate issuer name, and certificate signature. The identification information of the first digital certificate may be information such as the first digital certificate serial number or the name of the first digital certificate.
[0054] Step 205: Call a preset SDK to send an OCSP request to an Online Certificate Status Protocol OCSP server based on the identification information of the first digital certificate.
[0055] For example, the preset SDK can be pre-configured in the proxy server, and the proxy server can call the preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate. For example, the proxy server can send a first digital certificate status query to the OCSP server, and wait until the OCSP server returns a response. The OCSP request can include the following data: protocol version, service request, first digital certificate identification information, and optional extensions.
[0056] For example, an OCSP request includes request information and a signature for the request information, where the signature of the request information is optional. If the OCSP server is set to receive signed requests, but the request actually received is not signed, the OCSP server returns an error message "signature required". The request information includes the version number, requester name (optional), request list, and optional extensions. An OCSP request can query the status of multiple certificates.
[0057] Step 206: Receive the OCSP response fed back by the OCSP server.
[0058] After the proxy server sends a request for digital certificate status query to the OCSP server, the OCSP server will return a response to the received request. When the OCSP server returns an error message, the response does not need to be signed. The error message includes incorrect request encoding format, internal error, try again later, request requires signature, and unauthorized information. When the OCSP server returns a definite reply, the response must be digitally signed. A definite reply message includes the OCSP server version number, OCSP server name, reply to each requested digital certificate, optional extension signature algorithm object identifier and signature value, etc.
[0059] For example, an OCSP response usually includes a response status and a response byte. If the response status is an error, the response byte will not be set. There are six response status values: one is "success", which means that the OCSP server returns a definite reply to the received request. The other five are error messages: error messages include incorrect request encoding format, internal error, try again later, request requires signature, and unauthorized. If a request that does not follow the OCSP server syntax specification is received, the server returns "incorrect request encoding format" and the response status is "internal error", indicating that the OCSP server is in an inconsistent internal state and the request needs to be tried again; if the OCSP server is working but cannot return the status of the requested digital certificate, the response status is "try again later"; when the OCSP server needs to sign the request before generating a response, the response status is "request requires signature"; when it is not authorized to send a request to the OCSP server, the response status is "unauthorized". The value of the response byte consists of a response type identifier and a response information encoded as a string; the value of the response information is the encoding of the basic OCSP response; the signature value is the signature result of the response data, where the response data includes the version number, OCSP server identifier, response generation time, response list, and optional extensions. If an OCSP request contains multiple digital certificate query requests, the response list lists the responses to the status of all digital certificates in the request. Each digital certificate status response contains digital certificate identification information, digital certificate status, this update time, next update time (optional), and extensions. The digital certificate status may include the following three situations: normal, expired, or revoked.
[0060] Step 207: Determine the status of the first digital certificate based on the OCSP response.
[0061] As described in the above steps, the OCSP server includes a digital certificate status value in the reply to each requested digital certificate, and its digital certificate status value can be "normal", "expired" or "revoked (invalid)". The "normal" status indicates that the first digital certificate has not been revoked at this time, and the first digital certificate is valid. When the OCSP server returns the first digital certificate status as "normal", the proxy server sends the first digital certificate to the terminal, so that the terminal establishes a communication connection with the business server based on the first digital certificate. When the OSCP server returns the first digital certificate status as "revoked", it means that the first digital certificate has been revoked and cannot establish a communication connection with the business server normally. When the OSCP server returns the first digital certificate status as "expired", it means that the certificate has expired and the certificate is invalid.
[0062] Step 208: Determine whether the status of the first digital certificate is valid.
[0063] According to the above steps, the status of the first digital certificate of the OCSP response is received, and the status of the first digital certificate is further determined to be valid or invalid. When the status of the first digital certificate is valid, step 215 is executed, and when the status of the first digital certificate is invalid, step 209 is executed.
[0064] Step 209: Obtain the domain name of the target business server.
[0065] For example, the proxy server may parse the access request sent by the terminal to obtain the domain name of the target service server, or may obtain a pre-set or stored domain name of the target service server.
[0066] Step 210: Call the preset SDK to download the second digital certificate of the target service server from the CA server based on the domain name.
[0067] After obtaining the domain name information of the service server, the preset SDK is called to download the second digital certificate of the service server from the certificate authority CA server based on the domain name information of the current service server. For example, the proxy server downloads the second digital certificate from the CA server specifically including:
[0068] The proxy server sends the digital certificate application message of the business server to the CA server. In the digital certificate application process, the Secure Sockets Layer (SSL) is used to establish a connection with the CA server. Personal information is filled in, the browser generates a private key and a public key pair, and the private key is saved in a specific file of the proxy server. The private key is required to be protected by a password, and the public key and personal information are submitted to the security server. The security server transmits the user's application information to the Registration Authority (RA). The proxy server sends the user's identity information to the RA server. The operator corresponding to the RA server uses the browser to establish SSL secure communication with the RA server. The RA server needs to perform strict identity authentication on the operator, including the operator's digital certificate and IP address. The RA server operator checks the user information and can make appropriate modifications. If the RA server operator agrees to the user's certificate application request, the certificate application information must be digitally signed. All communications between the RA server operator and the RA server are encrypted and signed, which are secure and non-repudiation, ensuring the security and effectiveness of the communication process. After the RA server passes the review, the RA server transmits the user information and the identification information of the digital certificate to the CA server. After receiving the information, the CA server goes to the Key Management Center (KMC) to obtain the key pair, which is generated by the encryption machine. The CA server uses the user information and the public key obtained from the KMC to make a new digital certificate, and signs the new digital certificate. The proxy server can obtain the digital certificate from the CA server.
[0069] Further, after calling the preset SDK to download the second digital certificate from the CA server, the second digital certificate can be sent to the terminal, and the terminal can install the second digital certificate and delete the first digital certificate.
[0070] Step 211: Obtain identification information of the second digital certificate.
[0071] The identification information of the second digital certificate may be information such as the certificate serial number of the second digital certificate or the name of the second digital certificate.
[0072] Step 212: Call a preset SDK to query the status of the second digital certificate based on the identification information of the second digital certificate.
[0073] Specifically, the proxy server can call the preset SDK to send a certificate status query request to the OCSP server based on the identification information of the second digital certificate, and wait until the server returns a response. After the proxy server sends a certificate status query request to the OCSP server, the OCSP server will return a response to the received request, and the response contains a certain reply information, and the reply information includes information such as the server version number, server name, reply to the second digital certificate, optional extension signature algorithm object identifier and signature value. The reply information to the second digital certificate includes the status information of the second digital certificate, and the status information can be "normal", "expired" or "revoked". The "normal" status indicates that the certificate has not been revoked and the certificate is valid; the "revoked" status indicates that the certificate has been revoked; and the "expired" status indicates that the certificate has expired and is invalid.
[0074] Step 213: Determine whether the status of the second digital certificate is valid.
[0075] The OCSP server includes a digital certificate status value in the reply to each requested digital certificate, and the digital certificate status value can be "normal", "expired" (invalid) or "revoked (invalid)", and the "normal" status indicates that the second digital certificate has not been revoked at this time, and the second digital certificate is valid. When the OCSP server returns that the second digital certificate status is "normal", step 214 is executed. When the second digital certificate status is invalid, the communication ends.
[0076] Step 214: Send a second digital certificate to the terminal, so that the terminal establishes a communication connection with the target service server based on the second digital certificate.
[0077] When the status of the second digital certificate is valid, the proxy server sends the second digital certificate to the terminal, and the terminal establishes a communication connection with the service server based on the second digital certificate.
[0078] Step 215: Send the first digital certificate to the terminal, so that the terminal establishes a communication connection with the target service server based on the first digital certificate.
[0079] When the status of the first digital certificate is valid, the proxy server sends the first digital certificate to the terminal, and the terminal establishes a communication connection with the service server based on the first digital certificate.
[0080] The technical solution of this embodiment is to download and store the first digital certificate of each business server from the certificate authority CA server by calling the preset SDK; receive the access request sent by the terminal, the access request including the domain name of the target business server; load the first digital certificate of the target business server from the stored first digital certificates of each business server based on the domain name; load the first digital certificate of the target business server and obtain the identification information of the first digital certificate; call the preset SDK to send an OCSP request to the online certificate status protocol OCSP server based on the identification information of the first digital certificate; receive the OCSP response fed back by the OCSP server; determine the status of the first digital certificate based on the OCSP response; determine whether the status of the first digital certificate is valid; obtain the domain name of the target business server; call the preset SDK to download the second digital certificate of the target business server from the CA server based on the domain name; obtain the identification information of the second digital certificate; call the preset SDK to query the status of the second digital certificate based on the identification information of the second digital certificate; determine whether the status of the second digital certificate is valid; send the second digital certificate to the terminal so that the terminal establishes a communication connection with the target business server based on the second digital certificate; send the first digital certificate to the terminal so that the terminal establishes a communication connection with the target business server based on the first digital certificate. That is, in the embodiment of the present invention, the proxy server can use the preset SDK to automatically query the status of the digital certificate, and when the digital certificate is invalid, automatically download a new digital certificate and feed back the new digital certificate to the terminal, so that the terminal can establish a communication connection with the target business server based on the new digital certificate. The entire digital certificate acquisition process is automatically implemented through the SDK in the proxy server, and does not require user participation, which brings convenience to users.
[0081] Figure 3 1 is a structural diagram of a digital certificate acquisition device provided in an embodiment of the present invention, and the device is suitable for executing the digital certificate acquisition method provided in an embodiment of the present invention. Figure 3 As shown, the device may specifically include:
[0082] The acquisition module 301 is used to load the first digital certificate of the target service server and obtain the identification information of the first digital certificate;
[0083] A query module 302, configured to call a preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate;
[0084] The download module 303 is used to call the preset SDK to download the second digital certificate of the target service server when the status of the first digital certificate is invalid;
[0085] The sending module 304 is configured to send the second digital certificate to the terminal, so that the terminal establishes a communication connection with the target service server based on the second digital certificate.
[0086] Optionally, the download module 303 is further used for:
[0087] Call the preset SDK to download the first digital certificate of each business server from the certificate authority CA server and store it;
[0088] The acquisition module 301 loads the first digital certificate of the target service server, specifically including:
[0089] The first digital certificate of the target service server is loaded from the first digital certificates of each stored service server.
[0090] Optionally, the acquisition module 301 loads the first digital certificate of the target service server, specifically including:
[0091] Receiving an access request sent by a terminal, wherein the access request includes a domain name of the target service server;
[0092] The first digital certificate of the target service server is loaded from the stored first digital certificates of each service server based on the domain name.
[0093] Optionally, the query module 302 is specifically used for:
[0094] Calling the preset SDK to send an OCSP request to an online certificate status protocol OCSP server based on the identification information of the first digital certificate;
[0095] Receive an OCSP response fed back by the OCSP server;
[0096] A status of the first digital certificate is determined based on the OCSP response.
[0097] Optionally, the download module 303 is specifically used for:
[0098] The preset SDK is called to download the second digital certificate of the target service server.
[0099] Optionally, the download module 303 is specifically used for:
[0100] Obtain the domain name of the target service server;
[0101] The preset SDK is called to download the second digital certificate of the target business server from the CA server based on the domain name.
[0102] Optionally, the acquisition module 301 is further used to acquire identification information of the second digital certificate;
[0103] The query module 302 is further used to call the preset SDK to query the status of the second digital certificate based on the identification information of the second digital certificate;
[0104] The sending module 304 is specifically configured to, when the status of the second digital certificate is valid, send the second digital certificate to the terminal, so that the terminal establishes a communication connection with the target service server based on the second digital certificate.
[0105] The digital certificate acquisition device provided in the embodiment of the present invention can execute the digital certificate acquisition method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. The contents not described in detail in this embodiment can refer to the description in any method embodiment of the present invention.
[0106] The embodiment of the present invention also provides a digital certificate acquisition system, such as Figure 4 As shown, it includes a terminal 401 , a proxy server 402 , an OCSP server 403 , a CA server 404 and a business server 405 .
[0107] Terminal 401 is used to: send an access request to the proxy server 403, wherein the access request includes the domain name of the target business server, receive the first digital certificate or the second digital certificate sent by the proxy server 403, and when the first digital certificate is received, establish a communication connection with the target business server 405 based on the first digital certificate, or when the second digital certificate is received, establish a communication connection with the target business server 405 based on the second digital certificate.
[0108] The proxy server 402 is used to: send a certificate download request to the CA server and store the digital certificates of each business server, receive an access request sent by the terminal 401, load the first digital certificate of the target business server, obtain the identification information of the first digital certificate, send an OCSP request to the OCSP server 403 based on the identification information of the first digital certificate, receive the OCSP response fed back by the OCSP server 403, and determine the status of the first digital certificate based on the OCSP response; when the status of the first digital certificate is valid, send the first digital certificate to the terminal, so that the terminal can establish a communication connection with the target business server 405 based on the first digital certificate; When the status of the digital certificate is invalid, a certificate download request can be sent to the CA server 404 to download the second digital certificate of the business server 405 from the CA server 404; after downloading the second digital certificate, the identification information of the second digital certificate can be obtained, and an OCSP request can be sent to the OCSP server 403 based on the identification information of the second digital certificate, and an OCSP request can be received from the OCSP server 403, and the status of the second digital certificate can be determined based on the OCSP response; when the status of the second digital certificate is valid, the second digital certificate is sent to the terminal, so that the terminal establishes a communication connection with the target business server 405 based on the second digital certificate.
[0109] The OCSP server 403 is used to receive the OCSP request sent by the proxy server 402 and make an OCSP response.
[0110] The CA server 404 is used to receive the certificate download request from the proxy server 402, and send the first digital certificate of each service server and the second digital certificate of the target service server to the proxy server.
[0111] The target service server 405 is used to establish a communication connection with the terminal 401 based on a valid digital certificate (such as the first digital certificate or the second digital certificate).
[0112] For other implementation details of the specific digital certificate acquisition method, please refer to the description of the previous embodiment and will not be repeated here.
[0113] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0114] refer to Figure 5 , which shows a schematic diagram of the structure of a terminal computer system 500 suitable for implementing an embodiment of the present invention. Figure 5The terminal shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0115] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0116] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0117] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0118] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0119] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0120] The modules and / or units involved in the embodiments of the present invention may be implemented in software or hardware. The modules and / or units described may also be arranged in a processor, for example, it may be described as follows: a processor includes an acquisition module, a query module, a download module, and a sending module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.
[0121] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: loading the first digital certificate of the target business server and obtaining the identification information of the first digital certificate; calling the preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate; when the status of the first digital certificate is invalid, calling the preset SDK to download the second digital certificate of the target business server; sending the second digital certificate to the terminal, so that the terminal establishes a communication connection with the target business server based on the second digital certificate.
[0122] According to the technical solution of the embodiment of the present invention, an SDK is installed in the proxy server. After loading the first digital certificate of the target business server and obtaining the identification information of the first digital certificate, the proxy server will call the preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate; when the status of the first digital certificate is invalid, call the preset SDK to download the second digital certificate of the target business server; send the second digital certificate to the terminal, so that the terminal establishes a communication connection with the target business server based on the second digital certificate. That is, in the embodiment of the present invention, the proxy server can use the preset SDK to automatically query the status of the digital certificate, and when the digital certificate is invalid, automatically download a new digital certificate and feed back the new digital certificate to the terminal, so that the terminal establishes a communication connection with the target business server based on the new digital certificate. The entire digital certificate acquisition process is automatically implemented by the SDK in the proxy server, and does not require user participation, which brings convenience to users.
[0123] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for obtaining a digital certificate, characterized in that: Applied to a proxy server, wherein a preset software development kit SDK is installed in the proxy server, the method comprises: Loading a first digital certificate of a target service server and obtaining identification information of the first digital certificate; Calling a preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate; When the status of the first digital certificate is invalid, calling the preset SDK to download the second digital certificate of the target service server; Sending the second digital certificate to the terminal, so that the terminal establishes a communication connection with the target service server based on the second digital certificate; The first digital certificate includes the certificate serial number, certificate name, certificate expiration time, site organization name, site domain name system host name, site public key, certificate issuer name and certificate signature information; the second digital certificate is a digital signature formed by the CA server using the terminal public key, identity information and validity period information of the digital certificate as the original message, and encrypting and signing with the private key of the CA server, and the digital signature is composed of the public key, identity information and validity period of the second digital certificate owner of the second digital certificate; the version of the second digital certificate is higher than the version of the first digital certificate; The calling the preset SDK to download the second digital certificate of the target service server includes: Obtain the domain name of the target service server; Calling the preset SDK to download the second digital certificate of the target service server from the CA server based on the domain name; After calling the preset SDK to download the second digital certificate of the target service server, the method further includes: Obtaining identification information of the second digital certificate; Calling the preset SDK to query the status of the second digital certificate based on the identification information of the second digital certificate; When the status of the second digital certificate is valid, the step of sending the second digital certificate to the terminal is triggered so that the terminal establishes a communication connection with the target service server based on the second digital certificate.
2. The method for obtaining a digital certificate according to claim 1, characterized in that: Before loading the first digital certificate of the target service server, the method further includes: Calling the preset SDK to download and store the first digital certificate of each business server from the certificate authority CA server; The loading of the first digital certificate of the target service server includes: The first digital certificate of the target service server is loaded from the stored first digital certificates of each service server.
3. The method for obtaining a digital certificate according to claim 2, characterized in that: The step of loading the first digital certificate of the target service server from the stored first digital certificates of each service server includes: Receiving an access request sent by a terminal, wherein the access request includes a domain name of the target service server; The first digital certificate of the target service server is loaded from the stored first digital certificates of each service server based on the domain name.
4. The method for obtaining a digital certificate according to claim 1, characterized in that: The calling of the preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate includes: Calling the preset SDK to send an OCSP request to an online certificate status protocol OCSP server based on the identification information of the first digital certificate; Receive an OCSP response fed back by the OCSP server; A status of the first digital certificate is determined based on the OCSP response.
5. A digital certificate acquisition device, characterized in that: Applied to a proxy server, wherein a preset software development kit SDK is installed in the proxy server, the device comprises: An acquisition module, used to load a first digital certificate of a target service server and acquire identification information of the first digital certificate; A query module, used for calling a preset SDK to query the status of the first digital certificate based on the identification information of the first digital certificate; A download module, used for calling the preset SDK to download the second digital certificate of the target service server when the status of the first digital certificate is invalid; A sending module, configured to send the second digital certificate to the terminal, so that the terminal establishes a communication connection with the target service server based on the second digital certificate; The first digital certificate includes the certificate serial number, certificate name, certificate expiration time, site organization name, site domain name system host name, site public key, certificate issuer name and certificate signature information; the second digital certificate is a digital signature formed by the CA server using the terminal public key, identity information and validity period information of the digital certificate as the original message, and encrypting and signing with the private key of the CA server, and the digital signature is composed of the public key, identity information and validity period of the second digital certificate owner of the second digital certificate; the version of the second digital certificate is higher than the version of the first digital certificate; The download module is specifically used for: Obtain the domain name of the target service server; Calling the preset SDK to download the second digital certificate of the target service server from the CA server based on the domain name; The acquisition module is further used to acquire identification information of the second digital certificate; The query module is further used to call the preset SDK to query the status of the second digital certificate based on the identification information of the second digital certificate; The sending module is specifically configured to send the second digital certificate to the terminal when the status of the second digital certificate is valid, so that the terminal establishes a communication connection with the target service server based on the second digital certificate.
6. A digital certificate acquisition system, characterized in that: The invention comprises a terminal, an online certificate status protocol OCSP server, a certificate authority CA server, a target service server and a proxy server for executing the digital certificate acquisition method as claimed in any one of claims 1 to 4.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the digital certificate acquisition method as described in any one of claims 1 to 4 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for obtaining a digital certificate as described in any one of claims 1 to 4 is implemented.
