Skip to content

Commit 78eeba0

Browse files
committed
Add setters for new native methods and update Javadoc comments
1 parent fbf78a8 commit 78eeba0

File tree

2 files changed

+40
-16
lines changed

2 files changed

+40
-16
lines changed

java/org/apache/tomcat/jni/SSL.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -621,21 +621,33 @@ public final class SSL {
621621
public static native String[] getCiphers(long ssl);
622622

623623
/**
624-
* Returns the cipher suites available for negotiation in SSL handshake. <br>
624+
* Set the TLSv1.2 and below ciphers available for negotiation the in TLS handshake.
625+
* <p>
625626
* This complex directive uses a colon-separated cipher-spec string consisting of OpenSSL cipher specifications to
626-
* configure the Cipher Suite the client is permitted to negotiate in the SSL handshake phase. Notice that this
627-
* directive can be used both in per-server and per-directory context. In per-server context it applies to the
628-
* standard SSL handshake when a connection is established. In per-directory context it forces an SSL renegotiation
629-
* with the reconfigured Cipher Suite after the HTTP request was read but before the HTTP response is sent.
627+
* configure the ciphers the client is permitted to negotiate in the TLS handshake phase.
630628
*
631-
* @param ssl the SSL instance (SSL *)
632-
* @param ciphers an SSL cipher specification
629+
* @param ssl The SSL instance (SSL *)
630+
* @param cipherList An OpenSSL cipher specification.
631+
*
632+
* @return <code>true</code> if the operation was successful
633+
*
634+
* @throws Exception An error occurred
635+
*/
636+
public static native boolean setCipherSuites(long ssl, String cipherList) throws Exception;
637+
638+
/**
639+
* Set the TLSv1.3 cipher suites available for negotiation the in TLS handshake.
640+
* <p>
641+
* This uses a colon-separated list of TLSv1.3 cipher suite names in preference order.
642+
*
643+
* @param ssl The SSL instance (SSL *)
644+
* @param cipherSuites An OpenSSL cipher suite list.
633645
*
634646
* @return <code>true</code> if the operation was successful
635647
*
636648
* @throws Exception An error occurred
637649
*/
638-
public static native boolean setCipherSuites(long ssl, String ciphers) throws Exception;
650+
public static native boolean setCipherSuitesEx(long ssl, String cipherSuites) throws Exception;
639651

640652
/**
641653
* Returns the ID of the session as byte array representation.

java/org/apache/tomcat/jni/SSLContext.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,33 @@ public final class SSLContext {
9898
public static native String[] getCiphers(long ctx);
9999

100100
/**
101-
* Cipher Suite available for negotiation in SSL handshake. <br>
101+
* Set the TLSv1.2 and below ciphers available for negotiation the in TLS handshake.
102+
* <p>
102103
* This complex directive uses a colon-separated cipher-spec string consisting of OpenSSL cipher specifications to
103-
* configure the Cipher Suite the client is permitted to negotiate in the SSL handshake phase. Notice that this
104-
* directive can be used both in per-server and per-directory context. In per-server context it applies to the
105-
* standard SSL handshake when a connection is established. In per-directory context it forces an SSL renegotiation
106-
* with the reconfigured Cipher Suite after the HTTP request was read but before the HTTP response is sent.
104+
* configure the ciphers the client is permitted to negotiate in the TLS handshake phase.
107105
*
108-
* @param ctx Server or Client context to use.
109-
* @param ciphers An OpenSSL cipher specification.
106+
* @param ctx Server or Client context to use.
107+
* @param cipherList An OpenSSL cipher specification.
108+
*
109+
* @return <code>true</code> if the operation was successful
110+
*
111+
* @throws Exception An error occurred
112+
*/
113+
public static native boolean setCipherSuite(long ctx, String cipherList) throws Exception;
114+
115+
/**
116+
* Set the TLSv1.3 cipher suites available for negotiation the in TLS handshake.
117+
* <p>
118+
* This uses a colon-separated list of TLSv1.3 cipher suite names in preference order.
119+
*
120+
* @param ctx Server or Client context to use.
121+
* @param cipherSuites An OpenSSL cipher suite list.
110122
*
111123
* @return <code>true</code> if the operation was successful
112124
*
113125
* @throws Exception An error occurred
114126
*/
115-
public static native boolean setCipherSuite(long ctx, String ciphers) throws Exception;
127+
public static native boolean setCipherSuitesEx(long ctx, String cipherSuites) throws Exception;
116128

117129
/**
118130
* Set File of concatenated PEM-encoded CA CRLs or directory of PEM-encoded CA Certificates for Client Auth <br>

0 commit comments

Comments
 (0)