SSL strategy matching method and device

By obtaining the client's SSL/TLS access request and using the SAN extension field of the certificate to bind multiple domain names, the problem of SSL policy matching complexity in the load balancing device is solved, and efficient and simple SSL policy matching and system management efficiency are improved. .

CN118784575APending Publication Date: 2024-10-15HANGZHOU DPTECH TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410858234.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

In a load balancing device, when configuring multiple virtual hosts, existing technology is difficult to effectively match and manage SSL policies, resulting in complex configuration and difficulty in meeting specific application requirements, especially in encrypted communications between multiple domain names and virtual services.

Method used

By obtaining the client's SSL/TLS access request, determine the target SSL policy based on the SNI domain name, and use the SAN extension field of the certificate to bind multiple domain names to match the target SSL policy according to the preset priority order, simplifying the configuration process and improving system scalability. .

Benefits of technology

It significantly simplifies the SSL policy configuration process, improves the management efficiency and scalability of the system, realizes efficient and simple SSL policy matching, and reduces the number and complexity of SSL policy configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784575A_ABST
    Figure CN118784575A_ABST
Patent Text Reader

Abstract

The invention relates to an SSL strategy matching method and device. The method comprises the steps that load balancing equipment acquires an SSL / TLS access request from a client; obtaining an SNI domain name based on the SSL / TLS access request; when the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1, determining whether the SSL policies configure the SNI domain name; when the SNI domain name is configured in the SSL strategy, determining a target SSL strategy based on the SNI domain name, or the certificate, or the target domain name; determining a target certificate based on the target SSL strategy; and establishing communication connection for the client based on the target certificate. According to the SSL strategy matching method and device, the configuration process can be remarkably simplified, the expandability and management efficiency of the system can be improved, and SSL strategy matching can be efficiently, simply and conveniently carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer information processing, and in particular, to a method and device for matching SSL policies. Background Art

[0002] Load balancing is a technology that distributes workloads (such as network traffic, data requests, computing tasks, etc.) to multiple computing resources (such as servers, virtual machines, containers, etc.) to optimize performance, improve reliability, and increase scalability. There may be a server cluster behind the load balancing device, and multiple virtual hosts can be configured on each server. When using domain names and servers for encrypted communication, the load balancing device needs to divert traffic based on the domain name carried in the client request. For servers configured with multiple virtual hosts, during the encrypted communication process, it may be necessary to divert access from different domain names to a specified server.

[0003] In the prior art, when configuring an SSL acceleration policy, a load balancing device uses the SNI domain name as a configurable item and uses the configured domain name to match the SNI carried in client access. Different domain names use different SSL acceleration policies for encrypted communication.

[0004] A virtual service configuration can reference multiple SSL acceleration policies, and each SSL acceleration policy can be configured with an SNI domain name. When the SSL request initiated by the client carries the Server Name field and hits the virtual service, the SSL policy is selected based on the SNI or certificate CN field configured in the SSL policy referenced by the virtual service. If no SNI domain name matches the Server Name in the SSL acceleration policy referenced by the virtual service, the last SSL policy is selected by default for subsequent encrypted communications.

[0005] The disadvantage of the prior art is that when a server contains multiple virtual hosts and provides multiple domain names, to ensure that each domain name access can communicate normally, and the matching SSL policy is not the default policy, then the virtual service needs to reference multiple SSL policies, each SSL policy is configured with an SNI domain name. When the server contains a large number of virtual hosts, not only does it need to configure a large number of SSL acceleration policies, but the number of SSL policies that can be referenced by the virtual service is limited, which makes it difficult to meet specific application requirements.

[0006] Therefore, a new SSL policy matching method and device are needed.

[0007] The above information disclosed in the Background section is only for enhancement of understanding of the background of the present application and therefore it may contain information that does not constitute the prior art that is already known to a person of ordinary skill in the art. Summary of the invention

[0008] In view of this, the present application provides an SSL policy matching method and device, which can significantly simplify the configuration process, improve the scalability and management efficiency of the system, and can efficiently and conveniently perform SSL policy matching.

[0009] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0010] According to one aspect of the present application, a matching method for SSL policy is proposed, which can be used in a load balancing device, the method comprising: the load balancing device obtains an SSL / TLS access request from a client; obtains an SNI domain name based on the SSL / TLS access request; when the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1, determines whether the SSL policy is configured with the SNI domain name; when the SSL policy is configured with the SNI domain name, determines a target SSL policy based on the SNI domain name, or a certificate, or a target domain name; determines a target certificate based on the target SSL policy; and establishes a communication connection for the client based on the target certificate.

[0011] In an exemplary embodiment of the present application, it also includes: when applying for a certificate from a certificate authority, binding multiple domain names to the SAN extension field of the certificate; when configuring an SSL policy, referencing a certificate containing multiple domain names.

[0012] In an exemplary embodiment of the present application, the target SSL policy is determined based on the SNI domain name, or the certificate CN, or the target domain name, including: obtaining the target domain name from the SAN extension field of the SSL / TLS access request; determining the target SSL policy according to the SNI domain name, or the certificate, or the target domain name according to a preset priority order.

[0013] In an exemplary embodiment of the present application, the target SSL policy is determined according to the SNI domain name, or the certificate, or the target domain name in accordance with a preset priority order, including: determining whether the SSL policy is configured with the SNI domain name; when the SNI domain name is configured, matching the SNI domain name with the Server Name accessed by the client, and determining the target SSL policy according to a multi-policy selection rule; when the SNI domain name is not configured, determining the target SSL policy through the certificate or the target domain name.

[0014] In an exemplary embodiment of the present application, the target SSL policy is determined by a certificate or a target domain name, including: obtaining the CN field of the certificate; matching the CN field with the Server Name accessed by the client; when the match is successful, determining the target SSL policy according to a multi-policy selection rule; when the match is unsuccessful, determining the target SSL policy by the target domain name.

[0015] In an exemplary embodiment of the present application, the target SSL policy is determined by the target domain name, including: matching the target domain name with the Server Name accessed by the client; when the match is successful, determining the target SSL policy according to multiple policy selection rules; when the match is unsuccessful, performing the next policy match to determine the target SSL policy.

[0016] According to one aspect of the present application, a method for matching SSL policies is proposed, which can be used on a client, the method comprising: the client generates an SSL / TLS access request based on a target domain name; sends the SSL / TLS access request to a load balancing device; obtains a target certificate from the load balancing device based on the SSL / TLS access request; and establishes a communication connection based on the target certificate.

[0017] In an exemplary embodiment of the present application, generating an SSL / TLS access request based on the target domain name includes: placing the target domain name into a SAN extension field of the SSL / TLS access request.

[0018] According to one aspect of the present application, a matching device for an SSL policy is proposed, which can be used in a load balancing device, and the device includes: a request module, used for the load balancing device to obtain an SSL / TLS access request from a client; a parsing module, used to obtain an SNI domain name based on the SSL / TLS access request; a judgment module, used to determine whether the SSL policy is configured with an SNI domain name when the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1; a policy module, used to determine a target SSL policy based on the SNI domain name, or a certificate, or a target domain name when the SSL policy is configured with an SNI domain name; a certificate module, used to determine a target certificate based on the target SSL policy; and a connection module, used to establish a communication connection for the client based on the target certificate.

[0019] According to one aspect of the present application, a matching device for an SSL policy is proposed, which can be used in a client. The device includes: a domain name module, which is used by the client to generate an SSL / TLS access request based on a target domain name; an access module, which is used to send the SSL / TLS access request to a load balancing device; a response module, which is used to obtain a target certificate from the load balancing device based on the SSL / TLS access request; and a communication module, which is used to establish a communication connection based on the target certificate.

[0020] According to one aspect of the present application, an electronic device is proposed, which includes: 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 as described above.

[0021] According to one aspect of the present application, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.

[0022] According to the SSL policy matching method and device of the present application, an SSL / TLS access request from a client is obtained through a load balancing device; an SNI domain name is obtained based on the SSL / TLS access request; when the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1, it is determined whether the SSL policy is configured with the SNI domain name; when the SSL policy is configured with the SNI domain name, a target SSL policy is determined based on the SNI domain name, or a certificate, or a target domain name; a target certificate is determined based on the target SSL policy; and a communication connection is established for the client based on the target certificate, which can significantly simplify the configuration process, improve the scalability and management efficiency of the system, and enable efficient and convenient SSL policy matching.

[0023] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The above and other objects, features and advantages of the present application will become more apparent by describing in detail the exemplary embodiments thereof with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present application, and it is clear to a person skilled in the art that other accompanying drawings can be obtained from these accompanying drawings without creative effort.

[0025] Figure 1 It is a system block diagram of a method and device for matching SSL policies according to an exemplary embodiment.

[0026] Figure 2 The present invention is a flowchart of a method for matching an SSL policy according to an exemplary embodiment.

[0027] Figure 3 The figure is a flowchart of a method for matching SSL policies according to another exemplary embodiment.

[0028] Figure 4 The figure is a flowchart of a method for matching SSL policies according to another exemplary embodiment.

[0029] Figure 5 The figure is a block diagram of a device for matching SSL policies according to an exemplary embodiment.

[0030] Figure 6 It is a block diagram of a device for matching SSL policies according to another exemplary embodiment.

[0031] Figure 7It is a block diagram of an electronic device according to an exemplary embodiment.

[0032] Figure 8 It is a block diagram of a computer-readable medium according to an exemplary embodiment. DETAILED DESCRIPTION

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0034] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the present application.

[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0037] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the concepts of the present application. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.

[0038] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present application, and therefore cannot be used to limit the scope of protection of the present application.

[0039] The technical abbreviations involved in this application are explained as follows:

[0040] Load balancing is to evenly distribute business traffic to backend servers. Based on different business environments and server conditions, load balancing uses a pre-selected scheduling algorithm to reasonably distribute business traffic to backend servers, ensuring the normal, stable, and efficient operation of backend servers.

[0041] Virtual service: The application service provided by the load balancing device is called a virtual service. The virtual service is configured on the application delivery device and is uniquely identified by the IP address, protocol, and port number. The customer's access request reaches the application delivery device through the network. After matching the virtual service based on these identifiers, the application delivery device distributes it to the real service according to the configured delivery strategy.

[0042] SSL acceleration: In traditional SSL transmission, the client and server directly perform encrypted transmission, which will occupy a large amount of server system resources and processing performance. SSL acceleration is to migrate the encryption and decryption functions of the server to the load balancing device. SSL acceleration relies on virtual services. After configuring the virtual service and the established policy, the SSL acceleration policy is referenced, and then the virtual service can decrypt the received SSL message and distribute the decrypted plaintext data to the real service according to the established policy; after receiving the data replied by the server, the load balancing device encrypts the plaintext data and sends it to the client.

[0043] SSL / TLS (Transport Layer Security, abbreviated as TLS) / (Secure Sockets Layer, formerly Secure Sockets Layer, abbreviated as SSL) is a security protocol that aims to provide security and data integrity for Internet communications. Netscape launched the first version of the web browser, Netscape Navigator, in 1994, and launched the HTTPS protocol, which was encrypted with SSL. This is the origin of SSL. IETF standardized SSL and published the first version of the TLS standard document in 1999. Subsequently, RFC 5246 (August 2008) and RFC 6176 (March 2011) were published. This protocol is widely supported in applications such as browsers, email, instant messaging, VoIP, and Internet fax. Major websites such as Google and Facebook also use this protocol to create secure connections and send data. It has now become the industrial standard for confidential communications on the Internet.

[0044] SSL includes the record layer and the transport layer. The record layer protocol determines the encapsulation format of the transport layer data. The transport layer security protocol uses X.509 authentication, and then uses asymmetric encryption algorithms to authenticate the communication parties, and then exchanges symmetric keys as session keys. This session key is used to encrypt the data exchanged between the two communication parties, ensuring the confidentiality and reliability of the communication between the two applications, so that the communication between the client and the server application will not be eavesdropped by attackers.

[0045] SNI (Server Name Indication) first appeared in RFC4366 (April 2006), and was defined in detail in RFC6066 (January 2011). TLS does not provide a mechanism for the client to tell the server the name of the server it is contacting. For a server that hosts multiple virtual hosts on a single server, the domain name that the client needs to access becomes essential. Therefore, SNI was added as an extension of SSL / TLS, which allows the client to carry the Server Name field when initiating an SSL request. The content is the domain name information that needs to be accessed. After receiving the request, the server matches the specified SSL policy based on the SNI domain name information.

[0046] SAN, SAN (Subject Alternative Name) is defined in RFC5280 (May 2008). It is an extension of X.509 digital certificates, which allows identity information to be bound to the subject field of the certificate, which is a supplement or replacement for identity information. It can include Internet email addresses, DNS names, IP addresses, and uniform resource identifiers (URIs). By adding alternative names to the SAN extension field, the certificate can be applied to multiple domain names. This can simplify certificate management and reduce the complexity of server configuration.

[0047] Figure 1 It is a system block diagram of a method and device for matching SSL policies according to an exemplary embodiment.

[0048] like Figure 1 As shown, the system architecture 10 may include terminal devices 101, 102, 103, a network 104 and a load balancing device 105, and servers 106, 107, 108. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the load balancing device 105, and between the load balancing device 105 and the servers 106, 107, 108. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0049] Users can use clients, such as terminal devices 101, 102, 103, to interact with servers 106, 107, 108 through load balancing device 105 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0050] The terminal devices 101 , 102 , and 103 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.

[0051] In order to optimize performance and improve security, SSL acceleration policies are usually configured in the load balancing device 105. These policies are used to decrypt and encrypt SSL / TLS communications. The traditional approach is to configure the SNI (Server Name Indication) domain name to match the domain name in the client request, and select the appropriate SSL policy based on the matching result, so that the client's message can be sent to the server 106, 107, 108.

[0052] Terminal devices 101, 102, 103 may, for example, generate an SSL / TLS access request based on a target domain name; terminal devices 101, 102, 103 may, for example, send the SSL / TLS access request to a load balancing device; terminal devices 101, 102, 103 may, for example, obtain a target certificate from the load balancing device based on the SSL / TLS access request; terminal devices 101, 102, 103 may, for example, establish a communication connection based on the target certificate.

[0053] The load balancing device 105 can, for example, obtain SSL / TLS access requests from terminal devices 101, 102, and 103; the load balancing device 105 can, for example, obtain the SNI domain name based on the SSL / TLS access request; the load balancing device 105 can, for example, determine whether the SSL policy is configured with the SNI domain name when the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1; the load balancing device 105 can, for example, determine the target SSL policy based on the SNI domain name, or the certificate, or the target domain name when the SSL policy is configured with the SNI domain name; the load balancing device 105 can, for example, determine the target certificate based on the target SSL policy; the load balancing device 105 can, for example, establish a communication connection for the client based on the target certificate.

[0054] It should be noted that the SSL policy matching method provided in the embodiment of the present application can be executed by the load balancing device 105 and the terminal devices 101, 102, 103, and accordingly, the SSL policy matching device can be set in the load balancing device 105 and the terminal devices 101, 102, 103. The web page end provided for users to browse products and the request end for merchant query are generally located in the terminal devices 101, 102, 103.

[0055] Figure 2 The flowchart of a matching method of an SSL policy according to an exemplary embodiment is shown. The matching method 20 of the SSL policy can be used for a load balancing device, and at least includes steps S202 to S212.

[0056] like Figure 2 As shown, in S202, the load balancing device obtains the SSL / TLS access request from the client. The load balancing device is used to distribute network traffic to multiple servers to optimize performance and improve reliability.

[0057] More specifically, the client initiates an HTTPS request to the server, and the load balancing device can receive the request by listening to a specific port (usually port 443).

[0058] In S204, the SNI domain name is obtained based on the SSL / TLS access request. In the ClientHello message of the SSL / TLS handshake, the client will include an SNI extension field, and the load balancing device reads the field to obtain the requested domain name. The ClientHello message is parsed to extract the value of the SNI field.

[0059] In S206, when the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1, determine whether the SSL policy is configured with the SNI domain name. Find the virtual service configuration that matches the extracted SNI domain name. Check the number of SSL policies configured under the virtual service. If there are multiple SSL policies, further check the configuration of each policy to determine whether the SNI domain name is configured.

[0060] In S208, when the SSL policy is configured with an SNI domain name, a target SSL policy is determined based on the SNI domain name, or the certificate, or the target domain name. For example, the target domain name can be obtained from the SAN extension field of the SSL / TLS access request; the target SSL policy is determined based on the SNI domain name, or the certificate, or the target domain name according to a preset priority order.

[0061] In one embodiment, it also includes: when applying for a certificate from a certificate authority, binding multiple domain names to the SAN extension field of the certificate; when configuring an SSL policy, referencing a certificate containing multiple domain names. When applying for a certificate from a CA, binding multiple domain names to the SAN extension field of the certificate, and referencing a certificate containing multiple domain names when configuring an SSL policy. More specifically, for example, when applying for a certificate, filling in multiple domain names into the SAN extension field ensures that one certificate can support multiple domain names. When configuring an SSL policy on a load balancing device, reference these certificates containing multiple domain names.

[0062] In this application, the SAN extension of the certificate is used. When applying for a certificate, the CA binds the domain name to be used to the SAN extension of the certificate. The SSL policy referenced by the virtual service does not need to configure the SNI domain name. After referencing the certificate, the domain name accessed can match the DNS in the SAN extension of the certificate and can match the policy.

[0063] In one embodiment, the target SSL policy is determined according to the SNI domain name, or the certificate, or the target domain name in accordance with a preset priority order, including: determining whether the SSL policy is configured with the SNI domain name; when the SNI domain name is configured, matching the SNI domain name with the Server Name accessed by the client, and determining the target SSL policy according to a multi-policy selection rule; when the SNI domain name is not configured, determining the target SSL policy through the certificate or the target domain name.

[0064] Furthermore, the target SSL policy is determined by the certificate or the target domain name, including: obtaining the CN field of the certificate; matching the CN field with the Server Name accessed by the client; when the match is successful, determining the target SSL policy according to the multi-policy selection rules; when the match is unsuccessful, determining the target SSL policy by the target domain name.

[0065] Furthermore, the target SSL policy is determined by the target domain name, including: matching the target domain name with the Server Name accessed by the client; when the match is successful, determining the target SSL policy according to multiple policy selection rules; when the match is unsuccessful, performing the next policy match to determine the target SSL policy.

[0066] In actual applications, the SNI field in the SSL request can be read. The CN (Common Name) and SAN (Subject Alternative Name) fields in the certificate referenced by the SSL policy can also be read. The target domain name (if any) can also be extracted from the SAN extension field of the SSL / TLS request, for example.

[0067] Prioritize matching SNI domain name: If the SSL policy is configured with an SNI domain name, the SSL policy that matches the SNI domain name is used first. Certificate matching: If the SNI domain name matching fails or is not configured, try to match the CN field of the certificate. Target domain name matching: If the certificate matching also fails, use the target domain name for matching.

[0068] In S210, a target certificate is determined based on the target SSL policy. Once the target SSL policy is determined, a corresponding certificate can be extracted from the policy. After the target certificate is determined, it is prepared to be sent to the client.

[0069] In S212, a communication connection is established for the client based on the target certificate. For example, the server sends the target certificate to the client and continues the SSL / TLS handshake. The client verifies the validity of the server certificate. If the verification is successful, the key exchange and the establishment of encrypted communication are continued. After the handshake is successful, the client and the server establish an encrypted communication channel and start secure data transmission.

[0070] According to the SSL policy matching method of the present application, an SSL / TLS access request from a client is obtained through a load balancing device; an SNI domain name is obtained based on the SSL / TLS access request; when the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1, it is determined whether the SSL policy is configured with the SNI domain name; when the SSL policy is configured with the SNI domain name, a target SSL policy is determined based on the SNI domain name, or a certificate, or a target domain name; a target certificate is determined based on the target SSL policy; and a communication connection is established for the client based on the target certificate, which can significantly simplify the configuration process, improve the scalability and management efficiency of the system, and enable efficient and convenient SSL policy matching.

[0071] It should be clearly understood that the present application describes how to form and use specific examples, but the principles of the present application are not limited to any details of these examples. On the contrary, based on the teaching of the content disclosed in the present application, these principles can be applied to many other embodiments.

[0072] Figure 3 The figure is a flowchart of a method for matching SSL policies according to another exemplary embodiment. Figure 3 The process 30 shown is for Figure 2 Detailed description of the process shown.

[0073] like Figure 3 As shown, in S302, the virtual service is hit. The client accesses the SNI and hits the virtual service through SNI mapping.

[0074] In S304, whether the number of SSL policies referenced by the virtual service is greater than 1.

[0075] In S306, whether the policy is configured with the SNI domain name. If the number of SSL policies referenced by the virtual service is greater than 1, the subsequent process continues, otherwise this policy is used as the default policy for encrypted communication.

[0076] In S308, whether the SNI domain name is successfully matched. If the SSL policy is configured with an SNI domain name, the configured SNI domain name is matched with the Server Name accessed by the client. If the match is successful, enter the selection rule of multiple policies, otherwise continue to match the next SSL policy.

[0077] In S310, whether the certificate CN is successfully matched. If the SSL policy does not configure the SNI domain name, the CN of the SSL policy certificate is matched with the Server Name accessed by the client. If the match is successful, enter the selection rule of multiple policies.

[0078] In S312, whether the domain name in the SAN extension is successfully matched, the DNS domain name in the SAN extension of the certificate is matched with the Server Name accessed by the client, and if the match is successful, multiple policy selection rules are entered.

[0079] In S314, multiple strategies are selected.

[0080] More specific details of the selection rules for multiple strategies are as follows:

[0081] If the Server Name extension carried by the client access can match multiple SSL policies referenced by the virtual service, you need to select one of these policies. The specific matching rules are as follows.

[0082] (1) If multiple SSL policies are matched and all of them are configured with SNI, the first matching one is selected.

[0083] (2) If multiple SSL policies are matched and none of them are configured with SNI, the CN and SAN of each policy certificate are matched in turn, and the first matching one is selected.

[0084] (3) If multiple SSL policies are matched, and both policies with SNI and those without SNI are present, the one with a CN or SAN match is selected. If multiple CN or SAN matches are present, the one that matches first is selected.

[0085] (4) If both the complete SNI and the wildcard SNI are matched, the complete SNI is used instead.

[0086] (5) Wildcard SNI matches only the first label of the domain name and cannot be empty. It does not match multiple domain name labels. For example, if the client accesses www.test.domain.com, there is only the SNI domain name *.domain.com. At this time, www.test.domain.com, domain.com and *.domain.com do not match.

[0087] In S316, continue matching the next policy.

[0088] This application significantly reduces the number and complexity of SSL policy configurations by using the SAN extension field of the certificate and selecting SSL policies according to intelligent rules. This not only improves the convenience of device use, but also saves storage space, thereby achieving more efficient and economical load balancing device management.

[0089] This application parses the SAN extension of the certificate configured by the SSL acceleration policy, matches the DNS domain name in the extension with the Server Name carried by the client access, and uses the SSL acceleration policy for encrypted communication if the match succeeds. If all policies fail to match, the last SSL policy is selected. The specific matching rules can be divided into matching rules for one policy and selection rules for multiple policies.

[0090] Figure 4 The flowchart of a method for matching SSL policies according to another exemplary embodiment is shown in FIG. 4. The method 40 for matching SSL policies can be used in a client, and at least includes steps S402 to S408.

[0091] like Figure 4 As shown, in S402, the client generates an SSL / TLS access request based on the target domain name. More specifically, the target domain name is placed in the SAN extension field of the SSL / TLS access request.

[0092] The client generates an SSL / TLS access request based on the target domain name. More specifically, the target domain name is placed in the SNI (Server Name Indication) extension field of the SSL / TLS access request.

[0093] Specifically, for example, the client determines the server domain name to be accessed, such as www.XXXX.com. The client generates an SSL / TLS handshake request (such as a ClientHello message). The SNI extension field is added to the ClientHello message, and the target domain name www.example.com is placed in the field. The generated ClientHello message is encapsulated into a request data packet and is ready to be sent to the server.

[0094] In S404, the SSL / TLS access request is sent to the load balancing device. The client establishes an initial connection (usually a TCP connection) with the load balancing device through the network. The ClientHello message containing the SNI extension field is sent to the load balancing device through the initial connection. The client waits for a response from the load balancing device to continue the SSL / TLS handshake process.

[0095] In S406, a target certificate is obtained from the load balancing device based on the SSL / TLS access request. The load balancing device receives the SSL / TLS request from the client, selects a suitable SSL policy based on the SNI domain name in the request, and sends the target certificate to the client.

[0096] In S408, a communication connection is established based on the target certificate. The client receives the ServerHello message and the target certificate sent by the load balancing device. The client verifies the validity of the received target certificate, including checking the signature, validity period, and certificate authority (CA) of the certificate. Then a communication connection is established.

[0097] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, the above functions defined by the above method provided in the present application are executed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0098] In addition, it should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0099] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0100] Figure 5 FIG. 1 is a block diagram of a matching device for an SSL policy according to an exemplary embodiment. Figure 5 As shown, the SSL policy matching device 50 includes: a request module 502, a parsing module 504, a judgment module 506, a policy module 508, a certificate module 510, and a connection module 512.

[0101] The request module 502 is used for the load balancing device to obtain the SSL / TLS access request from the client;

[0102] The parsing module 504 is used to obtain the SNI domain name based on the SSL / TLS access request;

[0103] The judgment module 506 is used to determine whether the SSL policy is configured with the SNI domain name when the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1;

[0104] The policy module 508 is used to determine the target SSL policy based on the SNI domain name, or the certificate, or the target domain name when the SSL policy is configured with the SNI domain name;

[0105] The certificate module 510 is used to determine a target certificate based on the target SSL policy;

[0106] The connection module 512 is used to establish a communication connection for the client based on the target certificate.

[0107] Figure 6 FIG. 1 is a block diagram of a matching device for an SSL policy according to another exemplary embodiment. Figure 6 As shown, the SSL policy matching device 60 includes: a domain name module 602, an access module 604, a response module 606, and a communication module 608.

[0108] The domain name module 602 is used by the client to generate an SSL / TLS access request based on the target domain name;

[0109] The access module 604 is used to send the SSL / TLS access request to the load balancing device;

[0110] The response module 606 is used to obtain a target certificate from the load balancing device based on the SSL / TLS access request;

[0111] The communication module 608 is used to establish a communication connection based on the target certificate.

[0112] According to the SSL policy matching device of the present application, an SSL / TLS access request from a client is obtained through a load balancing device; an SNI domain name is obtained based on the SSL / TLS access request; when the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1, it is determined whether the SSL policy is configured with the SNI domain name; when the SSL policy is configured with the SNI domain name, a target SSL policy is determined based on the SNI domain name, or a certificate, or a target domain name; a target certificate is determined based on the target SSL policy; and a communication connection is established for the client based on the target certificate, which can significantly simplify the configuration process, improve the scalability and management efficiency of the system, and enable efficient and convenient SSL policy matching.

[0113] In general, the present disclosure utilizes the SAN extension of the certificate. When applying for a certificate, the CA organization binds the domain name to be used to the SAN extension of the certificate. The SSL policy referenced by the virtual service does not need to configure the SNI domain name. After referencing the certificate, the domain name accessed can match the DNS in the SAN extension of the certificate, and can match the policy. Specifically, the present disclosure mainly parses the SAN extension of the certificate configured by the SSL acceleration policy, matches the DNS domain name in the extension with the ServerName carried by the client access, and uses the SSL acceleration policy for encrypted communication if the match is successful. When all policies fail to match, the last SSL policy is selected. The specific matching rules can be divided into matching rules for one policy and selection rules for multiple policies. The matching rules of a policy use the Server Name extension carried by the client access to match the SNI domain name configured by the policy, the certificate CN, and the DNS in the SAN extension of the certificate. In the matching rules of a specific policy, the client access carries SNI, and the virtual service is hit through the SNI mapping. Only when the number of SSL policies referenced by the virtual service is less than 1, this policy is used as the default policy for encrypted communication. If it is greater than 1, if the SSL policy is configured with an SNI domain name, the configured SNI domain name is matched with the Server Name accessed by the client. If the match is successful, the multiple policy selection rules are entered, otherwise the next SSL policy is matched. Or if the SSL policy is not configured with an SNI domain name, the CN of the SSL policy certificate is matched with the Server Name accessed by the client. If the match is successful, the multiple policy selection rules are entered, otherwise the DNS domain name in the certificate SAN extension is matched with the Server Name accessed by the client. If the match is successful, the multiple policy selection rules are entered, otherwise the next SSL policy is matched. The multiple policy selection rules are as follows: if the Server Name extension carried by the client access can match multiple SSL policies referenced by the virtual service, one of the multiple policies needs to be selected. In the specific multiple policy selection rules, if multiple SSL policies are matched and all of these SSL policies are configured with SNI, the first matching one is selected. If multiple SSL policies are matched and none of these SSL policies are configured with SNI, the CN and SAN of each policy certificate are matched in turn, and the first matching one is selected. If multiple SSL policies are matched, and both SNI-configured and non-SNI-configured policies exist in these multiple SSL policies, the one with CN and SAN matching is selected. If there are multiple CN and SAN matching policies, the one that matches first is used. If both the complete SNI and the wildcard SNI are matched, the complete SNI is used. The wildcard SNI only matches the first label of the domain name and cannot be empty. It does not match multiple domain name labels.For example: the client accesses with www.test.domain.com, and only has the SNI domain name *.domain.com. At this time, www.test.domain.com, domain.com and *.domain.com do not match. The present disclosure can make good use of the SAN extension of the certificate and select the SSL policy for encrypted communication according to the rules described in Section 3.2. At the same time, it can greatly reduce the number of SSL policy configurations on the load balancing device, reduce the complexity of the configuration, improve the convenience of device use, and save device storage space. Reasonably and fully use the extension fields of the SSL certificate. According to reasonable rules, select the SSL policy for encrypted communication with the client. Make the SSL policy configuration no longer cumbersome, increase the convenience of load balancing device configuration, and improve the device usage experience. Save device storage space.

[0114] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment.

[0115] Refer to the following Figure 7 hereinafter describes an electronic device 700 according to this embodiment of the present application. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0116] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), a display unit 740, etc.

[0117] The storage unit stores a program code, which can be executed by the processing unit 710, so that the processing unit 710 performs the steps described in this specification according to various exemplary embodiments of the present application. For example, the processing unit 710 can perform the following steps: Figure 2 , Figure 3 , Figure 4 Follow the steps shown in .

[0118] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 7201 and / or a cache memory unit 7202 , and may further include a read-only memory unit (ROM) 7203 .

[0119] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0120] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0121] The electronic device 700 may also communicate with one or more external devices 700' (e.g., keyboards, pointing devices, Bluetooth devices, etc.) to enable a user to communicate with the electronic device 700, and / or any device (e.g., routers, modems, etc.) that the electronic device 700 can communicate with one or more other computing devices. Such communication may be performed via an input / output (I / O) interface 750. In addition, the electronic device 700 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 760. The network adapter 760 may communicate with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0122] Through the above description of the implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Figure 8 As shown, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation mode of the present application.

[0123] The software product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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 thereof.

[0124] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0125] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0126] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the computer-readable medium implements the following functions: the load balancing device obtains an SSL / TLS access request from a client; obtains an SNI domain name based on the SSL / TLS access request; when the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1, determines whether the SSL policy is configured with the SNI domain name; when the SSL policy is configured with the SNI domain name, determines a target SSL policy based on the SNI domain name, or a certificate, or a target domain name; determines a target certificate based on the target SSL policy; and establishes a communication connection for the client based on the target certificate.

[0127] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.

[0128] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present application.

[0129] The exemplary embodiments of the present application are specifically shown and described above. It should be understood that the present application is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present application is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.

Claims

1. A matching method for SSL policy, which can be used for a load balancing device, is characterized in that: include: The load balancing device obtains the SSL / TLS access request from the client; Obtaining an SNI domain name based on the SSL / TLS access request; When the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1, determine whether the SSL policy is configured with the SNI domain name; When the SSL policy is configured with an SNI domain name, determining a target SSL policy based on the SNI domain name, or the certificate, or the target domain name; Determining a target certificate based on the target SSL policy; A communication connection is established for the client based on the target certificate.

2. The method according to claim 1, characterized in that Also includes: When applying for a certificate from a certificate authority, bind multiple domain names to the SAN extension field of the certificate; When configuring an SSL policy, reference a certificate that contains multiple domain names.

3. The method according to claim 1, characterized in that Determining a target SSL policy based on the SNI domain name, or the certificate CN, or the target domain name includes: Obtaining a target domain name from a SAN extension field of the SSL / TLS access request; The target SSL policy is determined according to the SNI domain name, or the certificate, or the target domain name in a preset priority order.

4. The method according to claim 3, characterized in that Determining a target SSL policy according to the SNI domain name, or the certificate, or the target domain name in a preset priority order includes: Determine whether the SSL policy is configured with the SNI domain name; When configuring the SNI domain name, the SNI domain name is matched with the Server Name accessed by the client, and the target SSL policy is determined according to the multi-policy selection rule; When the SNI domain name is not configured, the target SSL policy is determined by the certificate or the target domain name.

5. The method according to claim 4, characterized in that Determine the target SSL policy by certificate or target domain name, including: Obtain the CN field of the certificate; Match the CN field with the Server Name accessed by the client; When the match is successful, determining the target SSL policy according to the multi-policy selection rule; When the match is unsuccessful, the target SSL policy is determined by the target domain name.

6. The method according to claim 5, characterized in that Determining the target SSL policy by the target domain name includes: Match the target domain name with the Server Name accessed by the client; When the match is successful, determining the target SSL policy according to the multi-policy selection rule; When the match is unsuccessful, the next policy match is performed to determine the target SSL policy.

7. A matching method for SSL policy, which can be used for a client, is characterized in that: include: The client generates an SSL / TLS access request based on the target domain name; Sending the SSL / TLS access request to the load balancing device; Obtaining a target certificate from a load balancing device based on the SSL / TLS access request; A communication connection is established based on the target certificate.

8. The method according to claim 1, characterized in that The client generates an SSL / TLS access request based on the target domain name, including: The target domain name is placed in the SAN extension field of the SSL / TLS access request.

9. A SSL policy matching device, which can be used for a load balancing device, characterized in that: include: The request module is used by the load balancing device to obtain the SSL / TLS access request from the client; A parsing module, used to obtain an SNI domain name based on the SSL / TLS access request; A judgment module, used for determining whether the SSL policy is configured with the SNI domain name when the number of SSL policies in the virtual service hit by the SNI domain name is greater than 1; A policy module, for determining a target SSL policy based on the SNI domain name, or the certificate, or the target domain name when the SSL policy is configured with the SNI domain name; A certificate module, configured to determine a target certificate based on the target SSL policy; A connection module is used to establish a communication connection for the client based on the target certificate.

10. A SSL policy matching device, which can be used in a client, characterized in that: include: Domain name module, used by the client to generate SSL / TLS access requests based on the target domain name; An access module, used for sending the SSL / TLS access request to a load balancing device; A response module, used for obtaining a target certificate from a load balancing device based on the SSL / TLS access request; A communication module is used to establish a communication connection based on the target certificate.

Citation Information

Cited By

  • Organization identification of network access server devices into a multi-tenant cloud network access control service

    US12368712B2