[GitHub] [tomcat] rmaucher commented on issue #220: BZ 63879 - Remove unnecessary exception from NioSocketWrapper doClose

2019-10-30 Thread GitBox
rmaucher commented on issue #220: BZ 63879 - Remove unnecessary exception from 
NioSocketWrapper doClose
URL: https://github.com/apache/tomcat/pull/220#issuecomment-547775157
 
 
   I preferred simply removing the exception, usually knowing the caller is not 
useful. Thanks for the report.


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


With regards,
Apache Git Services

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



[GitHub] [tomcat] rmaucher closed pull request #220: BZ 63879 - Remove unnecessary exception from NioSocketWrapper doClose

2019-10-30 Thread GitBox
rmaucher closed pull request #220: BZ 63879 - Remove unnecessary exception from 
NioSocketWrapper doClose
URL: https://github.com/apache/tomcat/pull/220
 
 
   


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


With regards,
Apache Git Services

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



[tomcat] branch master updated: Avoid API change

2019-10-30 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 6c255a1  Avoid API change
6c255a1 is described below

commit 6c255a1501c38187a1260209f3f954bcc5ca7f83
Author: remm 
AuthorDate: Wed Oct 30 10:58:13 2019 +0100

Avoid API change

Deprecate method since it is now replaced by
AbstractEndpoint.getConnections.
---
 java/org/apache/coyote/AbstractProtocol.java  | 13 +++--
 java/org/apache/tomcat/util/net/AbstractEndpoint.java |  6 --
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProtocol.java 
b/java/org/apache/coyote/AbstractProtocol.java
index 9cfa6e9..d3d9d93 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -19,6 +19,7 @@ package org.apache.coyote;
 import java.net.InetAddress;
 import java.nio.ByteBuffer;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutionException;
@@ -1037,8 +1038,16 @@ public abstract class AbstractProtocol implements 
ProtocolHandler,
 
 
 @Override
-public Set> getOpenSockets() {
-return proto.getEndpoint().getConnections();
+public Set getOpenSockets() {
+Set> set = 
proto.getEndpoint().getConnections();
+Set result = new HashSet<>();
+for (SocketWrapperBase socketWrapper : set) {
+S socket = socketWrapper.getSocket();
+if (socket != null) {
+result.add(socket);
+}
+}
+return result;
 }
 
 
diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index d0188e6..74ba555 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -102,10 +102,12 @@ public abstract class AbstractEndpoint {
 /**
  * Obtain the currently open sockets.
  *
- * @return The socket wrappers for which the handler is tracking a 
currently
+ * @return The sockets for which the handler is tracking a currently
  * open connection
+ * @deprecated Unused, will be removed in Tomcat 10, replaced
+ * by AbstractEndpoint.getConnections
  */
-public Set> getOpenSockets();
+public Set getOpenSockets();
 
 /**
  * Release any resources associated with the given SocketWrapper.


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



[tomcat] branch master updated: Add missing i18n

2019-10-30 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 7eb93de  Add missing i18n
7eb93de is described below

commit 7eb93de5ad1477fa9f1fac8d5cdcd45fa2006beb
Author: remm 
AuthorDate: Wed Oct 30 11:03:55 2019 +0100

Add missing i18n
---
 java/org/apache/coyote/AbstractProtocol.java   | 4 ++--
 java/org/apache/coyote/LocalStrings.properties | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProtocol.java 
b/java/org/apache/coyote/AbstractProtocol.java
index d3d9d93..d30862e 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -1117,7 +1117,7 @@ public abstract class AbstractProtocol implements 
ProtocolHandler,
 rpName, null);
 rp.setRpName(rpName);
 } catch (Exception e) {
-getLog().warn("Error registering request");
+
getLog().warn(sm.getString("abstractProtocol.processorRegisterError"), e);
 }
 }
 }
@@ -1142,7 +1142,7 @@ public abstract class AbstractProtocol implements 
ProtocolHandler,
 rpName);
 rp.setRpName(null);
 } catch (Exception e) {
-getLog().warn("Error unregistering request", e);
+
getLog().warn(sm.getString("abstractProtocol.processorUnregisterError"), e);
 }
 }
 }
diff --git a/java/org/apache/coyote/LocalStrings.properties 
b/java/org/apache/coyote/LocalStrings.properties
index 90159d3..6eb6dc5 100644
--- a/java/org/apache/coyote/LocalStrings.properties
+++ b/java/org/apache/coyote/LocalStrings.properties
@@ -33,6 +33,8 @@ abstractProcessor.pushrequest.notsupported=Server push 
requests are not supporte
 abstractProcessor.socket.ssl=Exception getting SSL attributes
 
 abstractProtocol.mbeanDeregistrationFailed=Failed to deregister MBean named 
[{0}] from MBean server [{1}]
+abstractProtocol.processorRegisterError=Error registering request processor
+abstractProtocol.processorUnregisterError=Error unregistering request processor
 
 abstractProtocolHandler.asyncTimeoutError=Error processing async timeouts
 abstractProtocolHandler.destroy=Destroying ProtocolHandler [{0}]


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



[Bug 63892] New: TLS 1.3 with client auth fails with NOT_HANDSHAKING during handshake

2019-10-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63892

Bug ID: 63892
   Summary: TLS 1.3 with client auth fails with NOT_HANDSHAKING
during handshake
   Product: Tomcat 9
   Version: 9.0.x
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Connectors
  Assignee: dev@tomcat.apache.org
  Reporter: swani...@emailn.de
  Target Milestone: -

As discussed in 
http://mail-archives.apache.org/mod_mbox/tomcat-users/201910.mbox/%3Cee96a553-81ea-ad01-f51b-f638de934600%40apache.org%3E


I installed Tomcat 9.0.27 on my Windows 7 machine and using the following java
runtime to get support for TLSv1.3

Server built:  Oct 7 2019 09:57:22 UTC
Server version number: 9.0.27.0
Architecture:  amd64
JVM Version:   13.0.1+9
JVM Vendor:Oracle Corporation


My TLS connector is configured with client auth.

   

If i connect with a browser i can choose my client key but get an error
afterwards.

The following error happens in SecureNioChannel:
28-Oct-2019 10:04:27.939 FINE [https-jsse-nio-8443-exec-4]
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun Error during SSL
handshake
java.io.IOException: NOT_HANDSHAKING during handshake
at
org.apache.tomcat.util.net.SecureNioChannel.handshake(SecureNioChannel.java:193)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)
at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:830)

With java runtime 8 everything works fine but i do not have TLSv1.3 there, so
only a TLSv1.2 handshake is done.

Please note that the problem also occur with 8.5.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63894] New: SLHostConfig certificateVerification="optionalNoCA" certificateVerificationDepth="6" doesn't work

2019-10-30 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63894

Bug ID: 63894
   Summary: SLHostConfig certificateVerification="optionalNoCA"
certificateVerificationDepth="6" doesn't work
   Product: Tomcat 9
   Version: 9.0.x
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Connectors
  Assignee: dev@tomcat.apache.org
  Reporter: jfcl...@gmail.com
  Target Milestone: -

When trying to set certificateVerification="optionalNoCA"
certificateVerificationDepth="6" in SSLHostConfig I have noted that
verification is always 2 and the depth 10.

Basically I printed  it in SSL_callback_SSL_verify() in native/src/sslutils.c
and I don't get the optionalNoCA nor 6.

According to my traces:
In sslcontext.c setVerify level 3 depth 6
In SSL.c setVerify Level: 1 DeptH: 10
In SSL.c setVerify Level: 1 DeptH: 10

So the value is set properly and later overwritten twice :-(

My configuration is:







-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Log tweaks

2019-10-30 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 99952af  Log tweaks
99952af is described below

commit 99952af847b71c00c42007dfc5d0931b85eb3e61
Author: remm 
AuthorDate: Wed Oct 30 18:49:35 2019 +0100

Log tweaks
---
 java/org/apache/coyote/AbstractProtocol.java | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProtocol.java 
b/java/org/apache/coyote/AbstractProtocol.java
index d30862e..b32b546 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -1078,7 +1078,9 @@ public abstract class AbstractProtocol implements 
ProtocolHandler,
 // recycledProcessors since that pool is only for AJP or
 // HTTP processors
 recycledProcessors.push(processor);
-getLog().debug("Pushed Processor [" + processor + "]");
+if (getLog().isDebugEnabled()) {
+getLog().debug("Pushed Processor [" + processor + "]");
+}
 }
 }
 }
@@ -1136,7 +1138,7 @@ public abstract class AbstractProtocol implements 
ProtocolHandler,
 rp.setGlobalProcessor(null);
 ObjectName rpName = rp.getRpName();
 if (getLog().isDebugEnabled()) {
-getLog().debug("Unregister " + rpName);
+getLog().debug("Unregister [" + rpName + "]");
 }
 Registry.getRegistry(null, null).unregisterComponent(
 rpName);


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



[tomcat] branch 8.5.x updated (cf53f8a -> d97f33b)

2019-10-30 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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


from cf53f8a  Remove unnecessary code
 new 80aaff5  Add missing i18n
 new d97f33b  Log tweaks

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/coyote/AbstractProtocol.java   | 10 ++
 java/org/apache/coyote/LocalStrings.properties |  2 ++
 2 files changed, 8 insertions(+), 4 deletions(-)


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



[tomcat] 01/02: Add missing i18n

2019-10-30 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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

commit 80aaff53e1ecbf511fbf0b0284799f4f018eff2f
Author: remm 
AuthorDate: Wed Oct 30 11:03:55 2019 +0100

Add missing i18n
---
 java/org/apache/coyote/AbstractProtocol.java   | 4 ++--
 java/org/apache/coyote/LocalStrings.properties | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProtocol.java 
b/java/org/apache/coyote/AbstractProtocol.java
index 0171ff5..3c06d91 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -1037,7 +1037,7 @@ public abstract class AbstractProtocol implements 
ProtocolHandler,
 rpName, null);
 rp.setRpName(rpName);
 } catch (Exception e) {
-getLog().warn("Error registering request");
+
getLog().warn(sm.getString("abstractProtocol.processorRegisterError"), e);
 }
 }
 }
@@ -1062,7 +1062,7 @@ public abstract class AbstractProtocol implements 
ProtocolHandler,
 rpName);
 rp.setRpName(null);
 } catch (Exception e) {
-getLog().warn("Error unregistering request", e);
+
getLog().warn(sm.getString("abstractProtocol.processorUnregisterError"), e);
 }
 }
 }
diff --git a/java/org/apache/coyote/LocalStrings.properties 
b/java/org/apache/coyote/LocalStrings.properties
index 3f0fbdf..29d2e41 100644
--- a/java/org/apache/coyote/LocalStrings.properties
+++ b/java/org/apache/coyote/LocalStrings.properties
@@ -31,6 +31,8 @@ abstractProcessor.pushrequest.notsupported=Server push 
requests are not supporte
 abstractProcessor.socket.ssl=Exception getting SSL attributes
 
 abstractProtocol.mbeanDeregistrationFailed=Failed to deregister MBean named 
[{0}] from MBean server [{1}]
+abstractProtocol.processorRegisterError=Error registering request processor
+abstractProtocol.processorUnregisterError=Error unregistering request processor
 
 abstractProtocolHandler.destroy=Destroying ProtocolHandler [{0}]
 abstractProtocolHandler.destroyError=Failed to destroy end point associated 
with ProtocolHandler [{0}]


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



[tomcat] 02/02: Log tweaks

2019-10-30 Thread remm
This is an automated email from the ASF dual-hosted git repository.

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

commit d97f33b259dc6b74c54ec35127ad5b3d39637863
Author: remm 
AuthorDate: Wed Oct 30 18:49:35 2019 +0100

Log tweaks
---
 java/org/apache/coyote/AbstractProtocol.java | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProtocol.java 
b/java/org/apache/coyote/AbstractProtocol.java
index 3c06d91..be2bd40 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -998,7 +998,9 @@ public abstract class AbstractProtocol implements 
ProtocolHandler,
 // processors
 if (!processor.isUpgrade()) {
 recycledProcessors.push(processor);
-getLog().debug("Pushed Processor [" + processor + "]");
+if (getLog().isDebugEnabled()) {
+getLog().debug("Pushed Processor [" + processor + "]");
+}
 }
 }
 }
@@ -1056,7 +1058,7 @@ public abstract class AbstractProtocol implements 
ProtocolHandler,
 rp.setGlobalProcessor(null);
 ObjectName rpName = rp.getRpName();
 if (getLog().isDebugEnabled()) {
-getLog().debug("Unregister " + rpName);
+getLog().debug("Unregister [" + rpName + "]");
 }
 Registry.getRegistry(null, null).unregisterComponent(
 rpName);


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