[GitHub] [tomcat] jbampton opened a new pull request #314: Changed css to CSS

2020-07-03 Thread GitBox


jbampton opened a new pull request #314:
URL: https://github.com/apache/tomcat/pull/314


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] jbampton opened a new pull request #313: Fix case of JavaScript.

2020-07-03 Thread GitBox


jbampton opened a new pull request #313:
URL: https://github.com/apache/tomcat/pull/313


   Changes were:
   
   - `javascript` to `JavaScript`
   - `Javascript` to `JavaScript`



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] sephiroth-j edited a comment on pull request #311: support schemes "wss" and "ws" in WsHandshakeRequest.buildRequestUri()

2020-07-03 Thread GitBox


sephiroth-j edited a comment on pull request #311:
URL: https://github.com/apache/tomcat/pull/311#issuecomment-653173711


   I observed the exception in a project with Spring Boot 2.3 and Vaadin 14.2 
with an enabled 
[`ForwardedHeaderFilter`](https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/filter/ForwardedHeaderFilter.java).
   
   The setup was Traefik as reverse proxy with TLS termination, forwarding the 
request from the client to the backend listening on plain HTTP. The client 
starts a websocket request using the URI scheme "wss://". Traefik adds the 
header "X-Forwared-Proto: wss" (_among others_) when forwading the request. 
`ForwardedHeaderFilter` alters the scheme property of the `HttpServletRequest` 
to the value from the "X-Forwared-Proto" header. The result is an internal 
server error (500) caused by that `IllegalArgumentException`.
   
   p.s.
   stracktrace of exception
   ```
   [.1-8090-exec-10] o.a.c.c.C.[.[.[.[springServlet]  : 
Servlet.service() for servlet [springServlet] in context with path [/] threw 
exception
   
   java.lang.IllegalArgumentException: wsHandshakeRequest.unknownScheme
   at 
org.apache.tomcat.websocket.server.WsHandshakeRequest.buildRequestUri(WsHandshakeRequest.java:162)
 ~[tomcat-embed-websocket-9.0.36.jar!/:9.0.36]
   at 
org.apache.tomcat.websocket.server.WsHandshakeRequest.(WsHandshakeRequest.java:60)
 ~[tomcat-embed-websocket-9.0.36.jar!/:9.0.36]
   at 
org.apache.tomcat.websocket.server.UpgradeUtil.doUpgrade(UpgradeUtil.java:202) 
~[tomcat-embed-websocket-9.0.36.jar!/:9.0.36]
   at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:78) 
~[tomcat-embed-websocket-9.0.36.jar!/:9.0.36]
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
   at 
org.springframework.web.filter.ForwardedHeaderFilter.doFilterInternal(ForwardedHeaderFilter.java:158)
 ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
   at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
   at 
org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
 ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
   at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
   at 
org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
 ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
   at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
   at 
org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93)
 ~[spring-boot-actuator-2.3.1.RELEASE.jar!/:2.3.1.RELEASE]
   at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
   at 
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
 ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
   at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFil

[GitHub] [tomcat] rmaucher commented on pull request #312: Use StringBuilder instead of StringBuffer

2020-07-03 Thread GitBox


rmaucher commented on pull request #312:
URL: https://github.com/apache/tomcat/pull/312#issuecomment-653579373


   Looks good to me now. The change for rewrite is likely the most significant, 
the rest is probably not doing anything though.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] martin-g commented on pull request #312: Use StringBuilder instead of StringBuffer

2020-07-03 Thread GitBox


martin-g commented on pull request #312:
URL: https://github.com/apache/tomcat/pull/312#issuecomment-653508943


   OK. I've reverted the DBCP classes!
   And made some more changes from `.append(String)` to `.append(char)`



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [ANN] New committer: Raymond Augé

2020-07-03 Thread Felix Schumacher
Congrats and welcome!

Am 02.07.20 um 16:40 schrieb Mark Thomas:
> On behalf of the Tomcat committers I am pleased to announce that
> Raymond Augé (rotty3000) has been voted in as a new Tomcat committer.
>
> Please join me in welcoming him.
>
> Kind regards,
>
> Mark
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] markt-asf commented on pull request #312: Use StringBuilder instead of StringBuffer

2020-07-03 Thread GitBox


markt-asf commented on pull request #312:
URL: https://github.com/apache/tomcat/pull/312#issuecomment-653453487


   Yes, DBCP2 changes need to be made upstream.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 01/02: Revert "Direct use of the ALPN API"

2020-07-03 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 35d84487fd10bfd6f2a00494078a5e3eef1b1830
Author: remm 
AuthorDate: Fri Jul 3 11:16:24 2020 +0200

Revert "Direct use of the ALPN API"

This reverts commit 7763877a98e5c74bb579b64f31e938fea17290a5.
---
 java/org/apache/tomcat/util/compat/JreCompat.java  | 69 ++
 .../tomcat/util/compat/LocalStrings.properties |  3 +
 .../tomcat/util/net/AbstractJsseEndpoint.java  | 20 ++-
 .../apache/tomcat/util/net/SSLImplementation.java  |  1 +
 java/org/apache/tomcat/util/net/SSLUtil.java   | 12 
 .../apache/tomcat/util/net/SecureNio2Channel.java  |  9 ++-
 .../apache/tomcat/util/net/SecureNioChannel.java   |  9 ++-
 .../tomcat/util/net/jsse/JSSEImplementation.java   |  5 ++
 .../tomcat/util/net/openssl/OpenSSLEngine.java |  5 +-
 .../util/net/openssl/OpenSSLImplementation.java|  5 ++
 10 files changed, 131 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/JreCompat.java 
b/java/org/apache/tomcat/util/compat/JreCompat.java
index 2f0268f..8275e60 100644
--- a/java/org/apache/tomcat/util/compat/JreCompat.java
+++ b/java/org/apache/tomcat/util/compat/JreCompat.java
@@ -19,11 +19,18 @@ package org.apache.tomcat.util.compat;
 import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.net.URL;
 import java.net.URLConnection;
 import java.util.Deque;
 import java.util.jar.JarFile;
 
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLParameters;
+
+import org.apache.tomcat.util.res.StringManager;
+
 /**
  * This is the base implementation class for JRE compatibility and provides an
  * implementation based on Java 8. Sub-classes may extend this class and 
provide
@@ -37,6 +44,10 @@ public class JreCompat {
 private static final boolean graalAvailable;
 private static final boolean jre11Available;
 private static final boolean jre9Available;
+private static final StringManager sm = 
StringManager.getManager(JreCompat.class);
+
+protected static final Method setApplicationProtocolsMethod;
+protected static final Method getApplicationProtocolMethod;
 
 static {
 // This is Tomcat 9 with a minimum Java version of Java 8.
@@ -55,6 +66,17 @@ public class JreCompat {
 jre9Available = false;
 }
 jre11Available = instance.jarFileRuntimeMajorVersion() >= 11;
+
+Method m1 = null;
+Method m2 = null;
+try {
+m1 = SSLParameters.class.getMethod("setApplicationProtocols", 
String[].class);
+m2 = SSLEngine.class.getMethod("getApplicationProtocol");
+} catch (ReflectiveOperationException | IllegalArgumentException e) {
+// Only the newest Java 8 have the ALPN API, so ignore
+}
+setApplicationProtocolsMethod = m1;
+getApplicationProtocolMethod = m2;
 }
 
 
@@ -68,6 +90,11 @@ public class JreCompat {
 }
 
 
+public static boolean isAlpnSupported() {
+return setApplicationProtocolsMethod != null && 
getApplicationProtocolMethod != null;
+}
+
+
 public static boolean isJre9Available() {
 return jre9Available;
 }
@@ -96,6 +123,48 @@ public class JreCompat {
 
 
 /**
+ * Set the application protocols the server will accept for ALPN
+ *
+ * @param sslParameters The SSL parameters for a connection
+ * @param protocols The application protocols to be allowed for that
+ *  connection
+ */
+public void setApplicationProtocols(SSLParameters sslParameters, String[] 
protocols) {
+if (setApplicationProtocolsMethod != null) {
+try {
+setApplicationProtocolsMethod.invoke(sslParameters, (Object) 
protocols);
+} catch (IllegalAccessException | IllegalArgumentException | 
InvocationTargetException e) {
+throw new UnsupportedOperationException(e);
+}
+} else {
+throw new 
UnsupportedOperationException(sm.getString("jreCompat.noApplicationProtocols"));
+}
+}
+
+
+/**
+ * Get the application protocol that has been negotiated for connection
+ * associated with the given SSLEngine.
+ *
+ * @param sslEngine The SSLEngine for which to obtain the negotiated
+ *  protocol
+ *
+ * @return The name of the negotiated protocol
+ */
+public String getApplicationProtocol(SSLEngine sslEngine) {
+if (getApplicationProtocolMethod != null) {
+try {
+return (String) getApplicationProtocolMethod.invoke(sslEngine);
+} catch (IllegalAccessException | IllegalArgumentException | 
InvocationTargetException e) {
+throw new

[tomcat] 02/02: Revert

2020-07-03 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 091f11ff5c31e32b8615347ec88cd97dc858885a
Author: remm 
AuthorDate: Fri Jul 3 11:17:40 2020 +0200

Revert
---
 webapps/docs/changelog.xml | 8 
 1 file changed, 8 deletions(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 16e4fb2..fcd4cc8 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -45,14 +45,6 @@
   issues do not "pop up" wrt. others).
 -->
 
-  
-
-  
-Remove ALPN abstraction to simplify code. Tomcat now requires
-Java 8 251 or 252 for TLS support. (remm)
-  
-
-  
 
 
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated (7763877 -> 091f11f)

2020-07-03 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from 7763877  Direct use of the ALPN API
 new 35d8448  Revert "Direct use of the ALPN API"
 new 091f11f  Revert

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/tomcat/util/compat/JreCompat.java  | 69 ++
 .../tomcat/util/compat/LocalStrings.properties |  3 +
 .../tomcat/util/net/AbstractJsseEndpoint.java  | 20 ++-
 .../apache/tomcat/util/net/SSLImplementation.java  |  1 +
 java/org/apache/tomcat/util/net/SSLUtil.java   | 12 
 .../apache/tomcat/util/net/SecureNio2Channel.java  |  9 ++-
 .../apache/tomcat/util/net/SecureNioChannel.java   |  9 ++-
 .../tomcat/util/net/jsse/JSSEImplementation.java   |  5 ++
 .../tomcat/util/net/openssl/OpenSSLEngine.java |  5 +-
 .../util/net/openssl/OpenSSLImplementation.java|  5 ++
 webapps/docs/changelog.xml |  8 ---
 11 files changed, 131 insertions(+), 15 deletions(-)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] martin-g commented on pull request #312: Use StringBuilder instead of StringBuffer

2020-07-03 Thread GitBox


martin-g commented on pull request #312:
URL: https://github.com/apache/tomcat/pull/312#issuecomment-653443649


   I've reverted the changes to the generated classes.
   
   What about the DBCP2 classes ? Maybe they should be changed upstream and 
then copied over here ?



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [tomcat] branch master updated: Direct use of the ALPN API

2020-07-03 Thread Rémy Maucherat
On Fri, Jul 3, 2020 at 10:38 AM  wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> remm pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/tomcat.git
>
>
> The following commit(s) were added to refs/heads/master by this push:
>  new 7763877  Direct use of the ALPN API
> 7763877 is described below
>
> commit 7763877a98e5c74bb579b64f31e938fea17290a5
> Author: remm 
> AuthorDate: Fri Jul 3 10:37:58 2020 +0200
>
> Direct use of the ALPN API
>
> Tomcat 10 will now require at least Java 8_251, which was released in
> April 2020, for TLS support. Any Java 9+ JVM will work too.
> This will not be backported to Tomcat 9.0 as it slightly changes the
> APIs, although the changes are trivial.
>

Ok, so I messed up (I always use Java 8 to build):
https://github.com/apache/tomcat/actions/runs/156360081

Basically, if compiling for 8 as a source/target/release, 11 will produce
(bogus) compilation errors. Setting the target for 9 works for compiling
the classes but isn't a solution obviously. So Tomcat only builds on 8 now
:( Unless there's another compiler parameter to avoid that, there's no
option but to revert and go back to using reflection.

Rémy


[GitHub] [tomcat] martin-g commented on pull request #312: Use StringBuilder instead of StringBuffer

2020-07-03 Thread GitBox


martin-g commented on pull request #312:
URL: https://github.com/apache/tomcat/pull/312#issuecomment-653439627


   Thanks, @pzygielo !
   
   Also these seem to be the generated classes!



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] pzygielo commented on pull request #312: Use StringBuilder instead of StringBuffer

2020-07-03 Thread GitBox


pzygielo commented on pull request #312:
URL: https://github.com/apache/tomcat/pull/312#issuecomment-653434713


   > and which `append(char)` might be wrong.
   
   I suppose, there is change in produced result
   ```
   (1)  retval.append("\\t");
   (2)  retval.append('\t');
   ```
   as in first case "\t" (i.e. two-char string: `\` followed by `t`) is 
appended, and in second case - tab character ('\t') is.
   Unfortunately I can't tell if there is test to validate what is expected as 
all smoke test jobs pass.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Direct use of the ALPN API

2020-07-03 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 7763877  Direct use of the ALPN API
7763877 is described below

commit 7763877a98e5c74bb579b64f31e938fea17290a5
Author: remm 
AuthorDate: Fri Jul 3 10:37:58 2020 +0200

Direct use of the ALPN API

Tomcat 10 will now require at least Java 8_251, which was released in
April 2020, for TLS support. Any Java 9+ JVM will work too.
This will not be backported to Tomcat 9.0 as it slightly changes the
APIs, although the changes are trivial.
---
 java/org/apache/tomcat/util/compat/JreCompat.java  | 69 --
 .../tomcat/util/compat/LocalStrings.properties |  3 -
 .../tomcat/util/net/AbstractJsseEndpoint.java  | 20 +--
 .../apache/tomcat/util/net/SSLImplementation.java  |  1 -
 java/org/apache/tomcat/util/net/SSLUtil.java   | 12 
 .../apache/tomcat/util/net/SecureNio2Channel.java  |  9 +--
 .../apache/tomcat/util/net/SecureNioChannel.java   |  9 +--
 .../tomcat/util/net/jsse/JSSEImplementation.java   |  5 --
 .../tomcat/util/net/openssl/OpenSSLEngine.java |  5 +-
 .../util/net/openssl/OpenSSLImplementation.java|  5 --
 10 files changed, 7 insertions(+), 131 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/JreCompat.java 
b/java/org/apache/tomcat/util/compat/JreCompat.java
index 8275e60..2f0268f 100644
--- a/java/org/apache/tomcat/util/compat/JreCompat.java
+++ b/java/org/apache/tomcat/util/compat/JreCompat.java
@@ -19,18 +19,11 @@ package org.apache.tomcat.util.compat;
 import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.net.URL;
 import java.net.URLConnection;
 import java.util.Deque;
 import java.util.jar.JarFile;
 
-import javax.net.ssl.SSLEngine;
-import javax.net.ssl.SSLParameters;
-
-import org.apache.tomcat.util.res.StringManager;
-
 /**
  * This is the base implementation class for JRE compatibility and provides an
  * implementation based on Java 8. Sub-classes may extend this class and 
provide
@@ -44,10 +37,6 @@ public class JreCompat {
 private static final boolean graalAvailable;
 private static final boolean jre11Available;
 private static final boolean jre9Available;
-private static final StringManager sm = 
StringManager.getManager(JreCompat.class);
-
-protected static final Method setApplicationProtocolsMethod;
-protected static final Method getApplicationProtocolMethod;
 
 static {
 // This is Tomcat 9 with a minimum Java version of Java 8.
@@ -66,17 +55,6 @@ public class JreCompat {
 jre9Available = false;
 }
 jre11Available = instance.jarFileRuntimeMajorVersion() >= 11;
-
-Method m1 = null;
-Method m2 = null;
-try {
-m1 = SSLParameters.class.getMethod("setApplicationProtocols", 
String[].class);
-m2 = SSLEngine.class.getMethod("getApplicationProtocol");
-} catch (ReflectiveOperationException | IllegalArgumentException e) {
-// Only the newest Java 8 have the ALPN API, so ignore
-}
-setApplicationProtocolsMethod = m1;
-getApplicationProtocolMethod = m2;
 }
 
 
@@ -90,11 +68,6 @@ public class JreCompat {
 }
 
 
-public static boolean isAlpnSupported() {
-return setApplicationProtocolsMethod != null && 
getApplicationProtocolMethod != null;
-}
-
-
 public static boolean isJre9Available() {
 return jre9Available;
 }
@@ -123,48 +96,6 @@ public class JreCompat {
 
 
 /**
- * Set the application protocols the server will accept for ALPN
- *
- * @param sslParameters The SSL parameters for a connection
- * @param protocols The application protocols to be allowed for that
- *  connection
- */
-public void setApplicationProtocols(SSLParameters sslParameters, String[] 
protocols) {
-if (setApplicationProtocolsMethod != null) {
-try {
-setApplicationProtocolsMethod.invoke(sslParameters, (Object) 
protocols);
-} catch (IllegalAccessException | IllegalArgumentException | 
InvocationTargetException e) {
-throw new UnsupportedOperationException(e);
-}
-} else {
-throw new 
UnsupportedOperationException(sm.getString("jreCompat.noApplicationProtocols"));
-}
-}
-
-
-/**
- * Get the application protocol that has been negotiated for connection
- * associated with the given SSLEngine.
- *
- * @param sslEngine The SSLEngine for which to obtain the negotiated
- *  protocol
- *
- * @return The name of the negotiated protocol
- */
-public String getAppl

[GitHub] [tomcat] martin-g commented on pull request #312: Use StringBuilder instead of StringBuffer

2020-07-03 Thread GitBox


martin-g commented on pull request #312:
URL: https://github.com/apache/tomcat/pull/312#issuecomment-653404420


   @rmaucher Could you please comment on the changed lines ?
   I am not sure which code is generated and which `append(char)` might be 
wrong.
   Thanks!



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] rmaucher commented on pull request #312: Use StringBuilder instead of StringBuffer

2020-07-03 Thread GitBox


rmaucher commented on pull request #312:
URL: https://github.com/apache/tomcat/pull/312#issuecomment-653402387


   The "Append character instead of String when possible" seems wrong to me, 
and you're editing generated code there.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] martin-g opened a new pull request #312: Use StringBuilder instead of StringBuffer

2020-07-03 Thread GitBox


martin-g opened a new pull request #312:
URL: https://github.com/apache/tomcat/pull/312


   There is no need of synchronization when it is a method local variable.
   
   Append character instead of String when possible



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org