A request processing method and device
By obtaining the client's access request in the proxy server, determining the target website and certificate event policy, and processing the access request, it solves the problem of redundant configuration of different IPs or domain names on the same website, and improves server performance and processing efficiency.
Patent Information
- Application Number
- CN202110730317.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-29
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-06-29
AI Technical Summary
In the existing technology, when the same website corresponds to different destination IPs or destination domain names, processing rules need to be configured separately, which increases management difficulty and reduces server performance.
By obtaining the client's access request, determine the target website and target certificate, determine the certificate event strategy according to the preset processing strategy, and process the access request according to the certificate event strategy to avoid redundant configuration and improve proxy server performance.
It reduces the management difficulty of processing policies and improves the operating performance of the proxy server and the processing efficiency of access requests.
Smart Images

Figure CN113343155B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a request processing method and device. Background Art
[0002] In order to ensure data security in the Internet environment, data such as export traffic is often monitored to further manage Internet behavior.
[0003] During the monitoring process, corresponding configurations will be made for some special situations. For example, for client requests that require certificate verification, corresponding processing rules are configured for each destination IP or destination domain name in the client request to ensure normal business operations.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] For requests to the same website sent by different clients, the destination IP or destination domain name resolved each time may be different. Therefore, during configuration, it is necessary to configure separately for multiple destination IPs or destination domain names corresponding to the same website, which increases the difficulty of managing processing rules and may reduce the operating performance of the server. Summary of the invention
[0006] In view of this, an embodiment of the present invention provides a request processing method and device, which can reduce the management difficulty of processing strategies and help improve the operating performance of the proxy server.
[0007] To achieve the above objective, according to one aspect of an embodiment of the present invention, a request processing method is provided.
[0008] A request processing method according to an embodiment of the present invention, when applied to a proxy server, includes:
[0009] Obtaining an access request sent by a client, wherein the access request indicates a target server to be connected;
[0010] Determine a target website corresponding to the target server and a target certificate corresponding to the target website;
[0011] Determine the target certificate event policy corresponding to the target certificate according to a preset processing policy; the preset processing policy includes: one or more certificates corresponding to one or more website identifiers, and one or more certificate event policies corresponding to the one or more certificates;
[0012] The access request is processed according to the target certificate event policy.
[0013] Optionally, according to the preset processing strategy, determining whether a first certificate corresponding to the target website is stored locally;
[0014] If yes, use the first certificate as the target certificate;
[0015] If not, obtain a second certificate corresponding to the target server according to the SSL connection established with the target server; and use the second certificate as the target certificate.
[0016] Optionally, when the first certificate is not stored locally, determining the target certificate event policy corresponding to the target certificate according to a preset processing policy includes:
[0017] Using the second certificate as input of a hash algorithm to obtain a digest value corresponding to the second certificate;
[0018] The summary value is matched with the website identifier included in the preset processing strategy. If the match is successful, the certificate event policy corresponding to the successfully matched website identifier is used as the target certificate event policy.
[0019] Optionally, in the case where the digest value fails to match the website identifier in the processing policy,
[0020] A certificate event corresponding to the target certificate is generated according to the summary value, and a certificate event policy corresponding to the certificate event is configured according to a preset policy.
[0021] Optionally, determining the target certificate event policy corresponding to the target certificate according to a preset processing policy includes:
[0022] Determine a certificate chain corresponding to the second certificate, the certificate chain indicating one or more superior certificates corresponding to the second certificate;
[0023] According to the preset processing strategy, the certificate event policy corresponding to the superior certificate is determined, and the certificate event policy corresponding to the superior certificate is used as the target event policy.
[0024] Optionally, before determining the target website corresponding to the target server and the target certificate corresponding to the target website, the method further includes:
[0025] Establishing an SSL connection with the target server, and determining whether the access request requires a client certificate based on the SSL connection;
[0026] If yes, processing the access request according to the access mode corresponding to the client;
[0027] If not, forward the access request to the target server.
[0028] Optionally, the processing the access request according to the access mode corresponding to the client includes:
[0029] When the access mode is a transparent transmission mode, forwarding the access request to the target server; and
[0030] When the access request sent by the client is received again, the access request is forwarded to the target server.
[0031] Optionally, the processing the access request according to the access mode corresponding to the client includes:
[0032] When the access mode is a mode corresponding to the certificate event policy, obtaining a second certificate corresponding to the target server according to the SSL connection established with the target server;
[0033] Using the second certificate as input of a hash algorithm to obtain a digest value corresponding to the second certificate;
[0034] A certificate event corresponding to the target certificate is generated according to the summary value, and a certificate event policy corresponding to the certificate event is configured according to a preset policy.
[0035] Optionally, after obtaining the second certificate corresponding to the target server, the method further includes:
[0036] verifying the second certificate;
[0037] When it is verified that the second certificate is abnormal, the certificate event is generated, and the certificate event policy corresponding to the certificate event is configured according to a preset policy.
[0038] To achieve the above objective, according to another aspect of an embodiment of the present invention, a request processing device is provided.
[0039] A request processing device according to an embodiment of the present invention comprises: a request acquisition module, a certificate determination module, a policy determination module and a processing module; wherein:
[0040] The request acquisition module is used to acquire an access request sent by the client, wherein the access request indicates a target server to be connected;
[0041] The certificate determination module is used to determine the target website corresponding to the target server and the target certificate corresponding to the target website;
[0042] The policy determination module is used to determine the target certificate event policy corresponding to the target certificate according to a preset processing policy; the preset processing policy includes: one or more certificates corresponding to one or more website identifiers, and one or more certificate event policies corresponding to the one or more certificates;
[0043] The processing module is used to process the access request according to the target certificate event policy.
[0044] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device for processing a request is provided.
[0045] An electronic device for processing requests according to an embodiment of the present invention comprises: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement a request processing method according to an embodiment of the present invention.
[0046] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided.
[0047] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a request processing method according to an embodiment of the present invention is implemented.
[0048] One embodiment of the above invention has the following advantages or beneficial effects: pre-configure the processing strategy according to the website identifier, the certificate required for accessing the website, and the certificate event strategy corresponding to the certificate; when obtaining the access request from the client, determine the certificate event strategy corresponding to the target certificate required by the target website according to the target website corresponding to the target server indicated by the access request through the website identifier in the preset processing strategy, and then process the access request according to the target certificate event strategy. Thus, configuring the processing strategy according to the website identifier avoids the redundant configuration of the processing strategy when the same website corresponds to different destination IPs or destination domain names, reduces the difficulty of managing the processing strategy, and is conducive to improving the operating performance of the proxy server. In addition, the target certificate event strategy corresponding to the access request can be quickly determined according to the website identifier, which is also conducive to improving the processing efficiency of the access request.
[0049] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0051] Figure 1is a schematic diagram of main steps of a request processing method according to an embodiment of the present invention;
[0052] Figure 2 is a schematic diagram of main modules of a request processing device according to an embodiment of the present invention;
[0053] Figure 3 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0054] Figure 4 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0056] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.
[0057] The request processing method provided by the embodiment of the present invention can be applied to man-in-the-middle attack scenarios. For example, in order to protect the data security of an enterprise, the access request sent by the client to the target server can be intercepted by a proxy server to monitor the enterprise's export traffic and further manage the Internet access behavior in the enterprise.
[0058] Figure 1 It is a schematic diagram of main steps of a request processing method according to an embodiment of the present invention.
[0059] like Figure 1 As shown, a request processing method according to an embodiment of the present invention, when applied to a proxy server, mainly comprises the following steps:
[0060] Step S101: obtaining an access request sent by a client, wherein the access request indicates a target server to be connected.
[0061] Here, the proxy server can intercept the request sent by the client through a man-in-the-middle attack to obtain the access request initiated by the client. The access request can be an SSL (Secure Sockets Layer) handshake request initiated by the client to the target server. Through network configuration, the traffic can be hijacked to the proxy server, and the proxy server can subsequently establish an SSL connection with the target server based on the SSL handshake request.
[0062] It is understandable that the access request carries the IP address, domain name and / or other identification information corresponding to the target server, and the proxy server can determine the target server indicated by the access request by parsing the access request.
[0063] After the proxy server determines the target server indicated by the access request, it can establish an SSL connection with the target server and determine whether the access request requires a client certificate based on the SSL connection; if so, process the access request according to the access method corresponding to the client; if not, forward the access request to the target server.
[0064] Here, after the proxy server determines the target server indicated by the access request, it can establish an SSL connection with the target server, and then obtain whether the access request requires the client to send a client certificate. If the client certificate is not required, the proxy server directly forwards the access request to the target server, so that the target server processes the access request. If the access request requires a client certificate, the proxy server determines the access method corresponding to the client and processes the access request according to the access method corresponding to the client.
[0065] Among them, the access method corresponding to the client can be a transparent transmission method or a method corresponding to the certificate event policy.
[0066] In one embodiment of the present invention, when the access mode is a transparent transmission mode, the proxy server forwards the access request to the target server; and when receiving the access request sent by the client again, the proxy server forwards the access request to the target server.
[0067] When the client's access method is transparent transmission, the proxy server directly transparently transmits the access request this time, that is, sends the access request to the target server, and also transparently transmits the subsequent access requests sent by the client to the target website, that is, no man-in-the-middle attack is performed on subsequent access requests.
[0068] In another embodiment of the present invention, when the client's access method is configured with a certificate event, that is, the client's access method is a method corresponding to a certificate event policy, the proxy server obtains a second certificate corresponding to the target server based on an SSL connection established with the target server; uses the second certificate as input to a hash algorithm to obtain a summary value corresponding to the second certificate; generates a certificate event corresponding to the target certificate based on the summary value, and configures a certificate event policy corresponding to the certificate event based on a preset policy.
[0069] In the case where the client has configured a certificate event, the proxy server obtains the second certificate corresponding to the target server based on the SSL connection with the target server, and uses the second certificate as the input of the hash algorithm to obtain the unique key of the second certificate, and generates a certificate event with a default action of blocking. It can be understood that the default blocking action here is a feasible way to implement the preset policy, and the preset policy can also be other actions, such as warning actions or release actions. After generating a certificate event, the proxy server can display the certificate event policy corresponding to the certificate event to the administrator, so that the administrator can determine whether to change the certificate event policy according to actual business needs, that is, whether to change the corresponding action, and manage the Internet behavior more accurately. For example, when the action corresponding to the certificate event is a blocking action, the administrator can change it to a release action so that the proxy server forwards the corresponding access request.
[0070] Step S102: Determine a target website corresponding to the target server and a target certificate corresponding to the target website.
[0071] Step S103: Determine the target certificate event policy corresponding to the target certificate according to the preset processing policy; the preset processing policy includes: one or more certificates corresponding to one or more website identifiers, and one or more certificate event policies corresponding to the one or more certificates.
[0072] Taking the access request carrying the IP address or domain name corresponding to the target server as an example, after the proxy server parses the IP address or domain name from the access request, it can determine the target website corresponding to the IP address or domain name, and then determine the target certificate corresponding to the target website.
[0073] When determining the target certificate corresponding to the target website, it can be determined whether the first certificate corresponding to the target website is stored locally according to the preset processing strategy; if so, the first certificate is used as the target certificate; if not, the second certificate corresponding to the target server is obtained according to the SSL connection established with the target server; and the second certificate is used as the target certificate.
[0074] The preset processing strategy includes: one or more certificates corresponding to one or more website identifiers, and one or more certificate event strategies corresponding to the one or more certificates.
[0075] Among them, the certificate event policy may include: transparent transmission policy, blocking policy, warning policy and release policy, etc. Each certificate event policy corresponds to different actions. For example, the transparent transmission policy means that subsequent requests will no longer be decrypted by man-in-the-middle attack, and a tunnel will be established between the client and the target server. The blocking policy means interrupting the access request. The warning policy means pausing the access request and sending a redirect page to the client to inform the client user of the corresponding business risk. The user chooses whether to continue. If the user chooses to continue, he can continue to access the original page. It can be understood that when the certificate event is a client certificate event, the warning policy is actually the same as the blocking policy. In addition, the release policy means continuing to process the current access request, which requires man-in-the-middle decryption. It can be understood that when the certificate event is a client certificate event, the release policy is equivalent to the transparent transmission policy.
[0076] When determining the target certificate, the proxy server can first search in the local cache according to the IP address and / or domain name in the access request. If the corresponding first certificate is found, it means that the first certificate is the target certificate corresponding to the target website. At this time, the proxy server does not need to establish an SSL connection with the target server to obtain the target certificate. Of course, if the proxy server does not find the target certificate corresponding to the target server in the local cache, the proxy server establishes an SSL connection with the target server, obtains the second certificate corresponding to the target server, and uses the second certificate as the target certificate corresponding to the target website. Among them, the certificate in the embodiment of the present invention is an X509 certificate or a CA certificate, etc. It can be understood that in the embodiment of the present invention, the contents of the first certificate and the second certificate are the same, and the two are only different in storage location.
[0077] In one embodiment of the present invention, after obtaining the second certificate corresponding to the target server, the second certificate is used as the input of the hash algorithm to obtain the summary value corresponding to the second certificate; the summary value is matched with the website identifier included in the preset processing strategy, and if the match is successful, the certificate event policy corresponding to the successfully matched website identifier is used as the target certificate event policy.
[0078] Here, after obtaining the second certificate corresponding to the target server, the proxy server can use the second certificate as the input of the hash algorithm to obtain the unique key of the second certificate, and then match the unique key with the website identifier included in the preset processing policy. If a website identifier identical to the unique key is found in the preset processing policy, the certificate event policy corresponding to the corresponding website identifier is used as the certificate event policy corresponding to the unique key, and the certificate event policy is the target certificate event policy corresponding to the target website.
[0079] If the website identifier corresponding to the unique key is not found in the preset processing policy, that is, when the summary value of the second certificate fails to match the website identifier in the preset processing policy, the proxy server can generate a certificate event corresponding to the target certificate based on the summary value, and configure the certificate event policy corresponding to the certificate event according to the preset policy.
[0080] For example, the proxy server can generate a certificate event with a default action of blocking. It is understandable that the default blocking action here is a feasible way of preset policy, and the preset policy can also be other actions, such as warning action or release action. After generating the certificate event, the proxy server can also display the certificate event policy corresponding to the certificate event to the administrator, so that the administrator can determine whether to change the certificate event policy according to actual business needs, that is, whether to change the corresponding action, and manage the Internet behavior more accurately. For example, when the action corresponding to the certificate event is a blocking action, the administrator can change it to a release action so that the proxy server forwards the corresponding access request.
[0081] In an embodiment of the present invention, after obtaining the second certificate, the proxy server may further verify the second certificate; when it is verified that there is an abnormality in the second certificate, the certificate event is generated, and the certificate event policy corresponding to the certificate event is configured according to a preset policy.
[0082] For example, when the proxy server verifies that the second certificate has abnormal conditions such as CN mismatch, certificate expiration, self-signed certificate, etc., it can also generate a certificate event corresponding to the second certificate, and configure the certificate event policy (blocking policy) of the certificate event according to the preset policy (such as the default blocking action). After generating the certificate event, the proxy server can also display the certificate event policy corresponding to the certificate event to the administrator, so that the administrator can determine whether to change the certificate event policy according to actual business needs, that is, whether to change the corresponding action, and manage the Internet behavior more accurately. For example, when the action corresponding to the certificate event is a blocking action, the administrator can change it to a release action so that the proxy server forwards the corresponding access request.
[0083] In one embodiment of the present invention, after obtaining the second certificate corresponding to the target server, the certificate chain corresponding to the second certificate can be determined, and the certificate chain indicates one or more superior certificates corresponding to the second certificate; according to the preset processing strategy, the certificate event policy corresponding to the superior certificate is determined, and the certificate event policy corresponding to the superior certificate is used as the target event policy.
[0084] For example, when the second certificate is user certificate A, the intermediate certificates corresponding to the user certificate A are intermediate certificate B and intermediate certificate C, and the root certificate corresponding to the user certificate A is root certificate D. Then, root certificate D-intermediate certificate C-intermediate certificate B-user certificate A is the certificate chain corresponding to the second certificate. Among them, intermediate certificate B, intermediate certificate C and root certificate D are all superior certificates of user certificate A. After determining the certificate chain corresponding to the second certificate, the proxy server can traverse all CA certificates in the certificate chain to check whether each CA certificate in the certificate chain has a certificate hit by the preset processing policy. If so, the certificate processing policy corresponding to the certificate hit by the preset processing policy is used as the target event policy.
[0085] Still taking the certificate chain root certificate D-intermediate certificate C-intermediate certificate B-user certificate A corresponding to the second certificate A as an example, after determining the certificate chain, the proxy server traverses all certificates in the certificate chain (root certificate D, intermediate certificate C, intermediate certificate B and user certificate A). If any one of the root certificate D, intermediate certificate C, intermediate certificate B and user certificate A is hit by the preset processing policy, it is assumed here that the root certificate D is hit by the preset processing policy, then the certificate event policy corresponding to the root certificate D in the preset processing policy is used as the certificate event policy corresponding to the user certificate A, that is, the certificate event policy corresponding to the root certificate D is used as the target certificate event policy corresponding to this access request. Therefore, even if the preset processing policy does not include the certificate event policy corresponding to the second certificate corresponding to the target server, that is, the second certificate corresponding to the target server is not hit by the preset processing policy, the embodiment of the present invention can also determine the corresponding target event policy according to the superior certificate in the certificate chain corresponding to the second certificate, thereby increasing the probability that the second certificate is hit by the preset processing policy, thereby improving the processing efficiency of the access request.
[0086] It is understandable that the certificate chain corresponding to the second certificate may not be hit by the preset processing strategy. In this case, the proxy server can also generate a certificate event corresponding to the second certificate, and configure the certificate event policy of the generated certificate event according to the above-mentioned certificate event configuration method, for example, configure the default action of the generated certificate event to be a blocking action.
[0087] In addition, after determining / configuring the certificate event policy corresponding to the certificate event, the corresponding certificate event policy can be displayed to the administrator, so that the administrator can determine whether to change the certificate event policy according to actual business needs, that is, whether to change the corresponding action, and manage the Internet behavior more accurately. For example, when the action corresponding to the certificate event is a blocking action, the administrator can change it to a release action so that the proxy server forwards the corresponding access request.
[0088] In addition, in addition to determining the target event policy corresponding to the target certificate according to the preset processing policy, in an embodiment of the present invention, the user can also determine the target event policy through custom configuration. For example, the user can enter a specified domain name to download the certificate of the corresponding server or directly import the certificate, and generate a certificate event, and then configure the default action of the certificate event to configure the certificate event policy of the certificate event.
[0089] Step S104: Process the access request according to the target certificate event policy.
[0090] As mentioned above, the certificate event policy may include: transparent transmission policy, blocking policy, warning policy and release policy, etc. Each certificate event policy corresponds to different actions. For example, the transparent transmission policy means that subsequent requests will no longer be decrypted by man-in-the-middle attacks, and a tunnel will be established between the client and the target server. The blocking policy means interrupting the access request. The warning policy means pausing the access request and sending a redirect page to the client to inform the client user of the corresponding business risks. The user chooses whether to continue. If the user chooses to continue, he can continue to access the original page. When the certificate event is a client certificate event, the warning policy is actually the same as the blocking policy. In addition, the release policy means continuing to process the current access request, which requires man-in-the-middle decryption. When the certificate event is a client certificate event, the release policy is equivalent to the transparent transmission policy.
[0091] After determining the target certificate event policy, the access request is processed according to the action corresponding to the target event policy. For example, when the target event policy is a transparent transmission policy, the access request is forwarded, and the subsequent requests are no longer decrypted by the middleman attack; when the target event policy is a blocking policy, the access request is interrupted; when the target event policy is a warning policy, the access request is suspended, and a redirect page is sent to the client to inform the client user of the corresponding business risks; when the target event policy is a release policy, the current access request continues to be processed, and the subsequent requests need to be decrypted by the middleman attack.
[0092] According to a request processing method of an embodiment of the present invention, it can be seen that a processing strategy is pre-configured according to a website identifier, a certificate required for accessing the website, and a certificate event strategy corresponding to the certificate; when an access request from a client is obtained, the certificate event strategy corresponding to the target certificate required by the target website is determined by the website identifier in the preset processing strategy according to the target website corresponding to the target server indicated by the access request, and then the access request is processed according to the target certificate event strategy. Thus, configuring the processing strategy according to the website identifier avoids redundant configuration of the processing strategy when the same website corresponds to different destination IPs or destination domain names, reduces the difficulty of managing the processing strategy, and is conducive to improving the operating performance of the proxy server. Moreover, the target certificate event strategy corresponding to the access request can be quickly determined according to the website identifier, which is also conducive to improving the processing efficiency of the access request.
[0093] Figure 2 It is a schematic diagram of main modules of a request processing device according to an embodiment of the present invention.
[0094] like Figure 2 As shown, a request processing device 200 according to an embodiment of the present invention includes: a request acquisition module 201, a certificate determination module 202, a policy determination module 203 and a processing module 204; wherein,
[0095] The request acquisition module 201 is used to acquire an access request sent by a client, wherein the access request indicates a target server to be connected;
[0096] The certificate determination module 202 is used to determine the target website corresponding to the target server and the target certificate corresponding to the target website;
[0097] The policy determination module 203 is used to determine the target certificate event policy corresponding to the target certificate according to a preset processing policy; the preset processing policy includes: one or more certificates corresponding to one or more website identifiers, and one or more certificate event policies corresponding to the one or more certificates;
[0098] The processing module 204 is used to process the access request according to the target certificate event policy.
[0099] In one embodiment of the present invention, the certificate determination module 202 is used to determine whether a first certificate corresponding to the target website is stored locally according to the preset processing strategy; if so, use the first certificate as the target certificate; if not, obtain a second certificate corresponding to the target server based on the SSL connection established with the target server; and use the second certificate as the target certificate.
[0100] In one embodiment of the present invention, the policy determination module 203 is used to use the second certificate as the input of the hash algorithm to obtain the summary value corresponding to the second certificate when the first certificate is not stored locally; match the summary value with the website identifier included in the preset processing policy, and if the match is successful, use the certificate event policy corresponding to the successfully matched website identifier as the target certificate event policy.
[0101] In one embodiment of the present invention, the policy determination module 203 is used to generate a certificate event corresponding to the target certificate based on the summary value when the summary value fails to match the website identifier in the processing policy, and configure the certificate event policy corresponding to the certificate event according to a preset policy.
[0102] In one embodiment of the present invention, the policy determination module 203 is used to determine a certificate chain corresponding to the second certificate, where the certificate chain indicates one or more superior certificates corresponding to the second certificate;
[0103] According to the preset processing strategy, the certificate event policy corresponding to the superior certificate is determined, and the certificate event policy corresponding to the superior certificate is used as the target event policy.
[0104] In one embodiment of the present invention, the certificate determination module 202 is also used to establish an SSL connection with the target server, and determine whether the access request requires a client certificate based on the SSL connection; if so, process the access request according to the access method corresponding to the client; if not, forward the access request to the target server.
[0105] In one embodiment of the present invention, the certificate determination module 202 is used to forward the access request to the target server when the access mode is transparent transmission; and forward the access request to the target server when receiving the access request sent by the client again.
[0106] In one embodiment of the present invention, the certificate determination module 202 is used to obtain a second certificate corresponding to the target server based on an SSL connection established with the target server when the access method is a method corresponding to the certificate event policy; use the second certificate as input to the hash algorithm to obtain a summary value corresponding to the second certificate; generate a certificate event corresponding to the target certificate based on the summary value, and configure the certificate event policy corresponding to the certificate event according to a preset policy.
[0107] In one embodiment of the present invention, the policy determination module 203 is used to verify the second certificate; when it is verified that the second certificate is abnormal, the certificate event is generated, and the certificate event policy corresponding to the certificate event is configured according to a preset policy.
[0108] It can be seen from a request processing device according to an embodiment of the present invention that a processing strategy is pre-configured according to a website identifier, a certificate required for accessing the website, and a certificate event strategy corresponding to the certificate; when an access request from a client is obtained, the certificate event strategy corresponding to the target certificate required by the target website is determined by the website identifier in the preset processing strategy according to the target website corresponding to the target server indicated by the access request, and then the access request is processed according to the target certificate event strategy. Thus, configuring the processing strategy according to the website identifier avoids redundant configuration of the processing strategy when the same website corresponds to different destination IPs or destination domain names, reduces the difficulty of managing the processing strategy, and is conducive to improving the operating performance of the proxy server. Moreover, the target certificate event strategy corresponding to the access request can be quickly determined according to the website identifier, which is also conducive to improving the processing efficiency of the access request.
[0109] Figure 3 An exemplary system architecture 300 is shown to which a request processing method or a request processing device according to an embodiment of the present invention can be applied.
[0110] like Figure 3 As shown, the system architecture 300 may include terminal devices 301, 302, 303, a network 304 and a server 305. The network 304 is used to provide a medium for communication links between the terminal devices 301, 302, 303 and the server 305. The network 304 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0111] Users can use terminal devices 301, 302, 303 to interact with server 305 through network 304 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 301, 302, 303, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0112] The terminal devices 301 , 302 , and 303 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0113] Server 305 may be a server that provides various services, such as a backend management server that provides support for shopping websites browsed by users using terminal devices 301, 302, and 303. The backend management server may analyze and process received data such as product information query requests, and feed back the processing results to the terminal device.
[0114] It should be noted that a request processing method provided in an embodiment of the present invention is generally executed by the server 305 , and accordingly, a request processing device is generally disposed in the server 305 .
[0115] It should be understood that Figure 3 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0116] Reference below Figure 4 , which shows a schematic diagram of the structure of a computer system 400 of a terminal device suitable for implementing an embodiment of the present invention. Figure 4 The terminal device 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.
[0117] like Figure 4 As shown, the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage part 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the system 400 are also stored. The CPU 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0118] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.
[0119] 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 409, and / or installed from the removable medium 411. When the computer program is executed by the central processing unit (CPU) 401, the above-mentioned functions defined in the system of the present invention are executed.
[0120] 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.
[0121] 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.
[0122] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a module, a module, and a module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the request acquisition module may also be described as a "module for acquiring access requests sent by a client".
[0123] 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: obtaining an access request sent by a client, the access request indicating a target server to be connected; determining a target website corresponding to the target server, and a target certificate corresponding to the target website; determining a target certificate event policy corresponding to the target certificate according to a preset processing policy; the preset processing policy includes: one or more certificates corresponding to one or more website identifiers, and one or more certificate event policies corresponding to the one or more certificates; processing the access request according to the target certificate event policy.
[0124] According to the technical solution of the embodiment of the present invention, a processing strategy is pre-configured according to the website identifier, the certificate required for accessing the website, and the certificate event strategy corresponding to the certificate; when the access request of the client is obtained, the certificate event strategy corresponding to the target certificate required by the target website is determined by the website identifier in the preset processing strategy according to the target website corresponding to the target server indicated by the access request, and then the access request is processed according to the target certificate event strategy. Thus, the processing strategy is configured according to the website identifier, which avoids the redundant configuration of the processing strategy when the same website corresponds to different destination IPs or destination domain names, reduces the difficulty of managing the processing strategy, and is conducive to improving the operating performance of the proxy server. In addition, the target certificate event strategy corresponding to the access request can be quickly determined according to the website identifier, which is also conducive to improving the processing efficiency of the access request.
[0125] 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.
Claims
1. A request processing method, It is characterized in that Applies to proxy servers; includes: Obtaining an access request sent by a client, wherein the access request indicates a target server to be connected; Determining a target website corresponding to the target server and a target certificate corresponding to the target website, including: determining whether a first certificate corresponding to the target website is stored locally according to a preset processing strategy, and if not, obtaining a second certificate corresponding to the target server according to an SSL connection established with the target server; and using the second certificate as the target certificate; According to the preset processing strategy, the target certificate event strategy corresponding to the target certificate is determined, including: when the first certificate corresponding to the target website is not stored locally, the second certificate is used as the input of the hash algorithm to obtain the summary value corresponding to the second certificate; the summary value is matched with the website identifier included in the preset processing strategy, and when the match is successful, the certificate event strategy corresponding to the successfully matched website identifier is used as the target certificate event strategy; the preset processing strategy includes: one or more certificates corresponding to one or more website identifiers, and one or more certificate event strategies corresponding to the one or more certificates; the certificate event strategy includes: a transparent transmission strategy, a blocking strategy, a warning strategy and / or a release strategy, and different certificate event strategies correspond to different actions; The access request is processed according to the target certificate event policy.
2. The method according to claim 1, It is characterized in that The determining, according to the preset processing strategy, whether the first certificate corresponding to the target website is stored locally includes: If yes, use the first certificate as the target certificate.
3. The method according to claim 1, It is characterized in that In the event that the digest value fails to match the website identifier in the processing policy, A certificate event corresponding to the target certificate is generated according to the summary value, and a certificate event policy corresponding to the certificate event is configured according to a preset policy.
4. The method according to claim 2, It is characterized in that The step of determining the target certificate event policy corresponding to the target certificate according to the preset processing policy includes: Determine a certificate chain corresponding to the second certificate, the certificate chain indicating one or more superior certificates corresponding to the second certificate; According to the preset processing strategy, the certificate event policy corresponding to the superior certificate is determined, and the certificate event policy corresponding to the superior certificate is used as the target certificate event policy.
5. The method according to claim 1, It is characterized in that Before determining the target website corresponding to the target server and the target certificate corresponding to the target website, the method further includes: Establishing an SSL connection with the target server, and determining whether the access request requires a client certificate based on the SSL connection; If yes, processing the access request according to the access mode corresponding to the client; If not, forward the access request to the target server.
6. The method according to claim 5, It is characterized in that The processing of the access request according to the access mode corresponding to the client includes: When the access mode is a transparent transmission mode, forwarding the access request to the target server; and When the access request sent by the client is received again, the access request is forwarded to the target server.
7. The method according to claim 5, It is characterized in that The processing of the access request according to the access mode corresponding to the client includes: When the access mode is a mode corresponding to the certificate event policy, obtaining a second certificate corresponding to the target server according to the SSL connection established with the target server; Using the second certificate as input of a hash algorithm to obtain a digest value corresponding to the second certificate; A certificate event corresponding to the target certificate is generated according to the summary value, and a certificate event policy corresponding to the certificate event is configured according to a preset policy.
8. The method according to claim 2 or 7, It is characterized in that After obtaining the second certificate corresponding to the target server, the method further includes: verifying the second certificate; When it is verified that the second certificate is abnormal, the certificate event is generated, and the certificate event policy corresponding to the certificate event is configured according to a preset policy.
9. A request processing device, It is characterized in that include: request acquisition module, certificate determination module, policy determination module and processing module; wherein, The request acquisition module is used to acquire an access request sent by the client, wherein the access request indicates a target server to be connected; The certificate determination module is used to determine the target website corresponding to the target server and the target certificate corresponding to the target website, including: determining whether a first certificate corresponding to the target website is stored locally according to a preset processing strategy, and if not, obtaining a second certificate corresponding to the target server according to an SSL connection established with the target server; and using the second certificate as the target certificate; The policy determination module is used to determine the target certificate event policy corresponding to the target certificate according to the preset processing policy, including: when the first certificate corresponding to the target website is not stored locally, using the second certificate as the input of the hash algorithm to obtain the summary value corresponding to the second certificate; matching the summary value with the website identifier included in the preset processing policy, and in the case of successful matching, using the certificate event policy corresponding to the successfully matched website identifier as the target certificate event policy; the preset processing policy includes: one or more certificates corresponding to one or more website identifiers, and one or more certificate event policies corresponding to the one or more certificates; the certificate event policy includes: a transparent transmission policy, a blocking policy, a warning policy and / or a release policy, and different certificate event policies correspond to different actions; The processing module is used to process the access request according to the target certificate event policy.
10. An electronic device for processing a request, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
11. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
