[GitHub] [tomcat] sheikhoo commented on pull request #628: Change style

2023-06-13 Thread via GitHub


sheikhoo commented on PR #628:
URL: https://github.com/apache/tomcat/pull/628#issuecomment-1590358538

   I removed any unnecessary spaces and utilized 4 spaces instead of 1 tab. 
Additionally, I updated the style of the buttons.


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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



Buildbot success in on tomcat-11.0.x

2023-06-13 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/112/builds/430
Blamelist: Mark Thomas , Sokratis Zappis 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch main] 5e5a3e35420f4fa7a950b482d50e0ce4773fc1d3


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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



Buildbot failure in on tomcat-9.0.x

2023-06-13 Thread buildbot
Build status: BUILD FAILED: failed Snapshot deployed to ASF Maven snapshot 
repository (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/594
Blamelist: Mark Thomas 
Build Text: failed Snapshot deployed to ASF Maven snapshot repository (failure)
Status Detected: new failure
Build Source Stamp: [branch 9.0.x] b9be37eeb9ec1ce5da3429d174810c57c3ae2ee8


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 2


-- ASF Buildbot


-
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 #625: Remove transport.bio from catalina-tribes.jar.tmp.bnd

2023-06-13 Thread via GitHub


markt-asf commented on PR #625:
URL: https://github.com/apache/tomcat/pull/625#issuecomment-1589667642

   Back-ported to 10.1.x as the package was removed in 10.1.x. Not back-ported 
further as the package is still present in 9.0.x and earlier.


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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 main updated: Remove transport.bio from catalina-tribes.jar.tmp.bnd

2023-06-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 5e5a3e3542 Remove transport.bio from catalina-tribes.jar.tmp.bnd
5e5a3e3542 is described below

commit 5e5a3e35420f4fa7a950b482d50e0ce4773fc1d3
Author: Sokratis Zappis 
AuthorDate: Mon Jun 12 19:21:22 2023 +0300

Remove transport.bio from catalina-tribes.jar.tmp.bnd
---
 res/bnd/catalina-tribes.jar.tmp.bnd | 1 -
 1 file changed, 1 deletion(-)

diff --git a/res/bnd/catalina-tribes.jar.tmp.bnd 
b/res/bnd/catalina-tribes.jar.tmp.bnd
index 09c7f54394..5b45cd88d6 100644
--- a/res/bnd/catalina-tribes.jar.tmp.bnd
+++ b/res/bnd/catalina-tribes.jar.tmp.bnd
@@ -26,7 +26,6 @@ Export-Package: \
 org.apache.catalina.tribes.membership,\
 org.apache.catalina.tribes.tipis,\
 org.apache.catalina.tribes.transport,\
-org.apache.catalina.tribes.transport.bio,\
 org.apache.catalina.tribes.transport.nio,\
 org.apache.catalina.tribes.util
 


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



[GitHub] [tomcat] markt-asf merged pull request #625: Remove transport.bio from catalina-tribes.jar.tmp.bnd

2023-06-13 Thread via GitHub


markt-asf merged PR #625:
URL: https://github.com/apache/tomcat/pull/625


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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



Buildbot failure in on tomcat-11.0.x

2023-06-13 Thread buildbot
Build status: BUILD FAILED: failed Snapshot deployed to ASF Maven snapshot 
repository (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/112/builds/429
Blamelist: Mark Thomas 
Build Text: failed Snapshot deployed to ASF Maven snapshot repository (failure)
Status Detected: new failure
Build Source Stamp: [branch main] eea2121c5113fcde0cac1d6da284c8031ffd3529


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 2


-- ASF Buildbot


-
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 #627: Remove transport.bio from catalina-tribes.jar.tmp.bnd

2023-06-13 Thread via GitHub


markt-asf commented on PR #627:
URL: https://github.com/apache/tomcat/pull/627#issuecomment-1589658475

   Redundant


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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] markt-asf closed pull request #627: Remove transport.bio from catalina-tribes.jar.tmp.bnd

2023-06-13 Thread via GitHub


markt-asf closed pull request #627: Remove transport.bio from 
catalina-tribes.jar.tmp.bnd
URL: https://github.com/apache/tomcat/pull/627


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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] markt-asf closed pull request #626: Remove transport.bio from catalina-tribes.jar.tmp.bnd

2023-06-13 Thread via GitHub


markt-asf closed pull request #626: Remove transport.bio from 
catalina-tribes.jar.tmp.bnd
URL: https://github.com/apache/tomcat/pull/626


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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] markt-asf commented on pull request #626: Remove transport.bio from catalina-tribes.jar.tmp.bnd

2023-06-13 Thread via GitHub


markt-asf commented on PR #626:
URL: https://github.com/apache/tomcat/pull/626#issuecomment-1589658187

   Redundant


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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] markt-asf commented on a diff in pull request #628: Change style

2023-06-13 Thread via GitHub


markt-asf commented on code in PR #628:
URL: https://github.com/apache/tomcat/pull/628#discussion_r1228412571


##
webapps/host-manager/css/manager.css:
##
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-body {
+ body {
 font-family: Tahoma, Arial, sans-serif;

Review Comment:
   This change appears to be unnecessary



##
webapps/host-manager/css/manager.css:
##
@@ -73,6 +79,7 @@ td.title {
 font-style: italic;
 font-weight   : bold;
 background: #D2A41C;
+   border-radius : 10px 10px 0 0;

Review Comment:
   Use 4 spaces rather than 1 tab for indents. This comment applies globally, 
not just to this line.



-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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



[Bug 66635] AbstractEndpoint#logCertificate() prints incorrect information

2023-06-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66635

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #1 from Mark Thomas  ---
Fixed in:
- 11.0.x for 11.0.0-M8 onwards
- 10.1.x for 10.1.11 onwards
-  9.0.x for  9.0.77 onwards
-  8.5.x for  8.5.91 onwards

-- 
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 8.5.x updated: Fix BZ 66635 Correctly log PEM based keys/certificates

2023-06-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 8e1dcfe9c5 Fix BZ 66635 Correctly log PEM based keys/certificates
8e1dcfe9c5 is described below

commit 8e1dcfe9c5d7bdab8679e45ce684cc8e6dcb7d58
Author: Mark Thomas 
AuthorDate: Tue Jun 13 17:18:52 2023 +0100

Fix BZ 66635 Correctly log PEM based keys/certificates

https://bz.apache.org/bugzilla/show_bug.cgi?id=66635
---
 .../apache/tomcat/util/net/AbstractEndpoint.java   | 25 +++---
 .../apache/tomcat/util/net/LocalStrings.properties |  4 +++-
 .../tomcat/util/net/LocalStrings_fr.properties |  3 ++-
 .../tomcat/util/net/LocalStrings_ja.properties |  1 -
 .../tomcat/util/net/SSLHostConfigCertificate.java  | 17 +--
 webapps/docs/changelog.xml |  6 ++
 6 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index 89739fa2c6..ee704bd1f3 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -50,6 +50,7 @@ import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.collections.SynchronizedStack;
 import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomcat.util.net.Acceptor.AcceptorState;
+import org.apache.tomcat.util.net.SSLHostConfigCertificate.StoreType;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.threads.LimitLatch;
 import org.apache.tomcat.util.threads.ResizableExecutor;
@@ -374,14 +375,22 @@ public abstract class AbstractEndpoint {
 protected void logCertificate(SSLHostConfigCertificate certificate) {
 SSLHostConfig sslHostConfig = certificate.getSSLHostConfig();
 
-String certificateSource = certificate.getCertificateKeystoreFile();
-if (certificateSource == null) {
-certificateSource = certificate.getCertificateKeyFile();
-}
+String certificateInfo;
 
-String keyAlias = certificate.getCertificateKeyAlias();
-if (keyAlias == null) {
-keyAlias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+if (certificate.getStoreType() == StoreType.PEM) {
+// PEM file based
+String keySource = certificate.getCertificateKeystoreFile();
+keySource = certificate.getCertificateKeyFile();
+certificateInfo = sm.getString("endpoint.tls.info.cert.pem", 
keySource, certificate.getCertificateFile(),
+certificate.getCertificateChainFile());
+} else {
+// Keystore based
+String keyStore = certificate.getCertificateKeystoreFile();
+String keyAlias = certificate.getCertificateKeyAlias();
+if (keyAlias == null) {
+keyAlias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+}
+certificateInfo = sm.getString("endpoint.tls.info.cert.keystore", 
keyStore, keyAlias);
 }
 
 String trustStoreSource = sslHostConfig.getTruststoreFile();
@@ -393,7 +402,7 @@ public abstract class AbstractEndpoint {
 }
 
 getLogCertificate().info(sm.getString("endpoint.tls.info", getName(), 
sslHostConfig.getHostName(),
-certificate.getType(), certificateSource, keyAlias, 
trustStoreSource));
+certificate.getType(), certificateInfo, trustStoreSource));
 
 if (getLogCertificate().isDebugEnabled()) {
 String alias = certificate.getCertificateKeyAlias();
diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/LocalStrings.properties
index 6b466f3078..5b1affe783 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -130,7 +130,9 @@ endpoint.socketOptionsError=Error setting socket options
 endpoint.timeout.err=Error processing socket timeout
 endpoint.tls.cert.encodingError=Certificate fingerprints not available
 endpoint.tls.cert.noCerts=Certificate details not available as the certificate 
chain returned from the SSLContext was empty
-endpoint.tls.info=Connector [{0}], TLS virtual host [{1}], certificate type 
[{2}] configured from [{3}] using alias [{4}] and with trust store [{5}]
+endpoint.tls.info=Connector [{0}], TLS virtual host [{1}], certificate type 
[{2}] configured from {3} with trust store [{4}]
+endpoint.tls.info.cert.pem=key [{0}], certificate [{1}] and certificate chain 
[{2}]
+endpoint.tls.info.cert.keystore=keystore [{0}] using alias [{1}]
 endpoint.unknownSslHostName=The SSL host name [{0}] is not recognised for this 
endpoint
 endpoint.warn.executorShutdown=The executor associated with thread pool [{0}] 
has not fully shutdown. Some 

[tomcat] branch 9.0.x updated: Fix BZ 66635 Correctly log PEM based keys/certificates

2023-06-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new b9be37eeb9 Fix BZ 66635 Correctly log PEM based keys/certificates
b9be37eeb9 is described below

commit b9be37eeb9ec1ce5da3429d174810c57c3ae2ee8
Author: Mark Thomas 
AuthorDate: Tue Jun 13 17:18:52 2023 +0100

Fix BZ 66635 Correctly log PEM based keys/certificates

https://bz.apache.org/bugzilla/show_bug.cgi?id=66635
---
 .../apache/tomcat/util/net/AbstractEndpoint.java   | 25 +++---
 .../apache/tomcat/util/net/LocalStrings.properties |  4 +++-
 .../tomcat/util/net/LocalStrings_fr.properties |  3 ++-
 .../tomcat/util/net/LocalStrings_ja.properties |  1 -
 .../tomcat/util/net/SSLHostConfigCertificate.java  | 17 +--
 webapps/docs/changelog.xml |  6 ++
 6 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index aa8debbb93..fd3278d51e 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -52,6 +52,7 @@ import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.collections.SynchronizedStack;
 import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomcat.util.net.Acceptor.AcceptorState;
+import org.apache.tomcat.util.net.SSLHostConfigCertificate.StoreType;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.threads.LimitLatch;
 import org.apache.tomcat.util.threads.ResizableExecutor;
@@ -376,14 +377,22 @@ public abstract class AbstractEndpoint {
 protected void logCertificate(SSLHostConfigCertificate certificate) {
 SSLHostConfig sslHostConfig = certificate.getSSLHostConfig();
 
-String certificateSource = certificate.getCertificateKeystoreFile();
-if (certificateSource == null) {
-certificateSource = certificate.getCertificateKeyFile();
-}
+String certificateInfo;
 
-String keyAlias = certificate.getCertificateKeyAlias();
-if (keyAlias == null) {
-keyAlias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+if (certificate.getStoreType() == StoreType.PEM) {
+// PEM file based
+String keySource = certificate.getCertificateKeystoreFile();
+keySource = certificate.getCertificateKeyFile();
+certificateInfo = sm.getString("endpoint.tls.info.cert.pem", 
keySource, certificate.getCertificateFile(),
+certificate.getCertificateChainFile());
+} else {
+// Keystore based
+String keyStore = certificate.getCertificateKeystoreFile();
+String keyAlias = certificate.getCertificateKeyAlias();
+if (keyAlias == null) {
+keyAlias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+}
+certificateInfo = sm.getString("endpoint.tls.info.cert.keystore", 
keyStore, keyAlias);
 }
 
 String trustStoreSource = sslHostConfig.getTruststoreFile();
@@ -395,7 +404,7 @@ public abstract class AbstractEndpoint {
 }
 
 getLogCertificate().info(sm.getString("endpoint.tls.info", getName(), 
sslHostConfig.getHostName(),
-certificate.getType(), certificateSource, keyAlias, 
trustStoreSource));
+certificate.getType(), certificateInfo, trustStoreSource));
 
 if (getLogCertificate().isDebugEnabled()) {
 String alias = certificate.getCertificateKeyAlias();
diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/LocalStrings.properties
index f5578360d5..7325bbf69a 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -134,7 +134,9 @@ endpoint.socketOptionsError=Error setting socket options
 endpoint.timeout.err=Error processing socket timeout
 endpoint.tls.cert.encodingError=Certificate fingerprints not available
 endpoint.tls.cert.noCerts=Certificate details not available as the certificate 
chain returned from the SSLContext was empty
-endpoint.tls.info=Connector [{0}], TLS virtual host [{1}], certificate type 
[{2}] configured from [{3}] using alias [{4}] and with trust store [{5}]
+endpoint.tls.info=Connector [{0}], TLS virtual host [{1}], certificate type 
[{2}] configured from {3} with trust store [{4}]
+endpoint.tls.info.cert.pem=key [{0}], certificate [{1}] and certificate chain 
[{2}]
+endpoint.tls.info.cert.keystore=keystore [{0}] using alias [{1}]
 endpoint.unknownSslHostName=The SSL host name [{0}] is not recognised for this 
endpoint
 endpoint.warn.executorShutdown=The executor associated with thread pool [{0}] 
has not fully shutdown. Some 

[tomcat] branch 10.1.x updated: Fix BZ 66635 Correctly log PEM based keys/certificates

2023-06-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 46645ef4af Fix BZ 66635 Correctly log PEM based keys/certificates
46645ef4af is described below

commit 46645ef4af866859acd158a43c69604589f07cc8
Author: Mark Thomas 
AuthorDate: Tue Jun 13 17:18:52 2023 +0100

Fix BZ 66635 Correctly log PEM based keys/certificates

https://bz.apache.org/bugzilla/show_bug.cgi?id=66635
---
 .../apache/tomcat/util/net/AbstractEndpoint.java   | 25 +++---
 .../apache/tomcat/util/net/LocalStrings.properties |  4 +++-
 .../tomcat/util/net/LocalStrings_fr.properties |  3 ++-
 .../tomcat/util/net/LocalStrings_ja.properties |  1 -
 .../tomcat/util/net/SSLHostConfigCertificate.java  | 17 +--
 webapps/docs/changelog.xml |  6 ++
 6 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index 6aa878788a..3f0862286b 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -52,6 +52,7 @@ import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.collections.SynchronizedStack;
 import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomcat.util.net.Acceptor.AcceptorState;
+import org.apache.tomcat.util.net.SSLHostConfigCertificate.StoreType;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.threads.LimitLatch;
 import org.apache.tomcat.util.threads.ResizableExecutor;
@@ -366,14 +367,22 @@ public abstract class AbstractEndpoint {
 protected void logCertificate(SSLHostConfigCertificate certificate) {
 SSLHostConfig sslHostConfig = certificate.getSSLHostConfig();
 
-String certificateSource = certificate.getCertificateKeystoreFile();
-if (certificateSource == null) {
-certificateSource = certificate.getCertificateKeyFile();
-}
+String certificateInfo;
 
-String keyAlias = certificate.getCertificateKeyAlias();
-if (keyAlias == null) {
-keyAlias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+if (certificate.getStoreType() == StoreType.PEM) {
+// PEM file based
+String keySource = certificate.getCertificateKeystoreFile();
+keySource = certificate.getCertificateKeyFile();
+certificateInfo = sm.getString("endpoint.tls.info.cert.pem", 
keySource, certificate.getCertificateFile(),
+certificate.getCertificateChainFile());
+} else {
+// Keystore based
+String keyStore = certificate.getCertificateKeystoreFile();
+String keyAlias = certificate.getCertificateKeyAlias();
+if (keyAlias == null) {
+keyAlias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+}
+certificateInfo = sm.getString("endpoint.tls.info.cert.keystore", 
keyStore, keyAlias);
 }
 
 String trustStoreSource = sslHostConfig.getTruststoreFile();
@@ -385,7 +394,7 @@ public abstract class AbstractEndpoint {
 }
 
 getLogCertificate().info(sm.getString("endpoint.tls.info", getName(), 
sslHostConfig.getHostName(),
-certificate.getType(), certificateSource, keyAlias, 
trustStoreSource));
+certificate.getType(), certificateInfo, trustStoreSource));
 
 if (getLogCertificate().isDebugEnabled()) {
 String alias = certificate.getCertificateKeyAlias();
diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/LocalStrings.properties
index 8e845821bd..43146c2c16 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -116,7 +116,9 @@ endpoint.socketOptionsError=Error setting socket options
 endpoint.timeout.err=Error processing socket timeout
 endpoint.tls.cert.encodingError=Certificate fingerprints not available
 endpoint.tls.cert.noCerts=Certificate details not available as the certificate 
chain returned from the SSLContext was empty
-endpoint.tls.info=Connector [{0}], TLS virtual host [{1}], certificate type 
[{2}] configured from [{3}] using alias [{4}] and with trust store [{5}]
+endpoint.tls.info=Connector [{0}], TLS virtual host [{1}], certificate type 
[{2}] configured from {3} with trust store [{4}]
+endpoint.tls.info.cert.pem=key [{0}], certificate [{1}] and certificate chain 
[{2}]
+endpoint.tls.info.cert.keystore=keystore [{0}] using alias [{1}]
 endpoint.unknownSslHostName=The SSL host name [{0}] is not recognised for this 
endpoint
 endpoint.warn.executorShutdown=The executor associated with thread pool [{0}] 
has not fully shutdown. Some 

[tomcat] branch main updated: Fix BZ 66635 Correctly log PEM based keys/certificates

2023-06-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new eea2121c51 Fix BZ 66635 Correctly log PEM based keys/certificates
eea2121c51 is described below

commit eea2121c5113fcde0cac1d6da284c8031ffd3529
Author: Mark Thomas 
AuthorDate: Tue Jun 13 17:18:52 2023 +0100

Fix BZ 66635 Correctly log PEM based keys/certificates

https://bz.apache.org/bugzilla/show_bug.cgi?id=66635
---
 .../apache/tomcat/util/net/AbstractEndpoint.java   | 25 +++---
 .../apache/tomcat/util/net/LocalStrings.properties |  4 +++-
 .../tomcat/util/net/LocalStrings_fr.properties |  3 ++-
 .../tomcat/util/net/LocalStrings_ja.properties |  1 -
 .../tomcat/util/net/SSLHostConfigCertificate.java  | 17 +--
 webapps/docs/changelog.xml |  6 ++
 6 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index 229e8600d2..1001e5490c 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -54,6 +54,7 @@ import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.collections.SynchronizedStack;
 import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomcat.util.net.Acceptor.AcceptorState;
+import org.apache.tomcat.util.net.SSLHostConfigCertificate.StoreType;
 import org.apache.tomcat.util.net.openssl.ciphers.Cipher;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.threads.LimitLatch;
@@ -421,14 +422,22 @@ public abstract class AbstractEndpoint {
 protected void logCertificate(SSLHostConfigCertificate certificate) {
 SSLHostConfig sslHostConfig = certificate.getSSLHostConfig();
 
-String certificateSource = certificate.getCertificateKeystoreFile();
-if (certificateSource == null) {
-certificateSource = certificate.getCertificateKeyFile();
-}
+String certificateInfo;
 
-String keyAlias = certificate.getCertificateKeyAlias();
-if (keyAlias == null) {
-keyAlias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+if (certificate.getStoreType() == StoreType.PEM) {
+// PEM file based
+String keySource = certificate.getCertificateKeystoreFile();
+keySource = certificate.getCertificateKeyFile();
+certificateInfo = sm.getString("endpoint.tls.info.cert.pem", 
keySource, certificate.getCertificateFile(),
+certificate.getCertificateChainFile());
+} else {
+// Keystore based
+String keyStore = certificate.getCertificateKeystoreFile();
+String keyAlias = certificate.getCertificateKeyAlias();
+if (keyAlias == null) {
+keyAlias = SSLUtilBase.DEFAULT_KEY_ALIAS;
+}
+certificateInfo = sm.getString("endpoint.tls.info.cert.keystore", 
keyStore, keyAlias);
 }
 
 String trustStoreSource = sslHostConfig.getTruststoreFile();
@@ -440,7 +449,7 @@ public abstract class AbstractEndpoint {
 }
 
 getLogCertificate().info(sm.getString("endpoint.tls.info", getName(), 
sslHostConfig.getHostName(),
-certificate.getType(), certificateSource, keyAlias, 
trustStoreSource));
+certificate.getType(), certificateInfo, trustStoreSource));
 
 if (getLogCertificate().isDebugEnabled()) {
 String alias = certificate.getCertificateKeyAlias();
diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/LocalStrings.properties
index 8e845821bd..43146c2c16 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -116,7 +116,9 @@ endpoint.socketOptionsError=Error setting socket options
 endpoint.timeout.err=Error processing socket timeout
 endpoint.tls.cert.encodingError=Certificate fingerprints not available
 endpoint.tls.cert.noCerts=Certificate details not available as the certificate 
chain returned from the SSLContext was empty
-endpoint.tls.info=Connector [{0}], TLS virtual host [{1}], certificate type 
[{2}] configured from [{3}] using alias [{4}] and with trust store [{5}]
+endpoint.tls.info=Connector [{0}], TLS virtual host [{1}], certificate type 
[{2}] configured from {3} with trust store [{4}]
+endpoint.tls.info.cert.pem=key [{0}], certificate [{1}] and certificate chain 
[{2}]
+endpoint.tls.info.cert.keystore=keystore [{0}] using alias [{1}]
 endpoint.unknownSslHostName=The SSL host name [{0}] is not recognised for this 
endpoint
 endpoint.warn.executorShutdown=The executor associated with thread pool [{0}] 
has not fully shutdown. Some application 

[GitHub] [tomcat] sheikhoo opened a new pull request, #628: Change style

2023-06-13 Thread via GitHub


sheikhoo opened a new pull request, #628:
URL: https://github.com/apache/tomcat/pull/628

   Just change some CSS style
   
   
![image](https://github.com/apache/tomcat/assets/11958698/44311e25-49b2-428d-89e4-5c0ace907d95)
   


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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



[Bug 59232] Make the context name of an app available via JNDI

2023-06-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=59232

--- Comment #5 from Michael Osipov  ---
(In reply to Mark Thomas from comment #4)
> Fixed via #624 and back-ports.
> 
> Fixed in:
> - 11.0.x for 11.0.0-M8 onwards
> - 10.1.x for 10.1.11 onwards
> -  9.0.x for  9.0.77 onwards
> -  8.5.x for  8.5.91 onwards

Ah, thanks, I completely forgot about this one.

-- 
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



Re: Potentially useful filter for debugging, etc.

2023-06-13 Thread Christopher Schultz

All,

On 6/6/23 10:07, Christopher Schultz wrote:

Mark,

On 6/6/23 06:42, Mark Thomas wrote:

devOn 02/06/2023 18:55, Christopher Schultz wrote:

Mark,

On 6/2/23 11:00, Mark Thomas wrote:

On 02/06/2023 15:35, Christopher Schultz wrote:

All,

I've built a Filter for use with a client who has many 
environments, many reverse proxies, and many application servers 
and were getting confused about what was what.


Basically, it just adds a "Via" header as appropriate and has some 
configurability to choose the header name, override the protocol 
and server-name if requested, and to limit the number of 
IP-segments reported in the value.


Would this be something useful to add to Tomcat?


That implies that Tomcat is acting as a reverse proxy. Given that 
functionality isn't built into Tomcat, I'd expect whatever component 
is providing the reverse proxy functionality to provide the Via 
header and any other appropriate debug tools. It seems a little odd 
to provide a debug tool with Tomcat for a feature that Tomcat 
doesn't implement.


I was thinking that Tomcat here was an origin server and reporting 
its own identity, etc. to the reverse-proxy, which would then add its 
own "Via" header.


I'm a little confused about how this all works.


Sorry, I think I didn't give enough explanation.

Shouldn't the reverse proxy add the Via header before forwarding the 
request?


Is the Filter adding a Via header? I read the original post as it was. 
But Via headers are for proxy's not origin servers.


Maybe an example would help. Or a link to the Filter's source.


It's possible that I may be abusing the HTTP Via header, but I don't 
think so.


The idea was to provide information to the *client* about which servers 
are handling the request. The HTTP Via header seems to fit the billing, 
as a response-header and not a request-header. I'm not worried about 
request-headers at all, here.


My Filter basically says 'add "Via: protocol/version myself" header to 
the response' and that's it. The reverse-proxy can augment the Via 
response header with its own. So for a simple setup where we have two 
web servers and two Tomcat servers cross-linked, the client might see a 
response header looking like this:


Via: HTTP/1.1 web1, HTTP/1.1 tomcat2

I am generally in favour of adding Filters that are generally useful 
but wary of things that appear to behave in unexpected ways.


As you should be.

I created this Filter to be used in a situation with multiple 
environments and where there are multiple reverse proxies between the 
client and the Tomcat server. We were tracking-down what we believed was 
a misconfiguration of one or more of the reverse-proxies that 
cross-linked environments and we needed to figure out which pair of 
reverse-proxy servers were being used in a simple way e.g. using curl. 
(Automation wasn't going to solve this one, unfortunately, given the way 
things had been deployed).


So we configured the Tomcat servers to announce themselves and the httpd 
servers to do the same, using the Via header in this way.


I suppose the httpd instance could set the header to include BOTH 
servers, since it really ought to know its own identity as well as the 
identity of the origin server it's connecting to, but ... I chose this 
way instead since upstream could be more complicated than httpd knows.


Here is the code of the doFilter function without the source of the 
supporting functions:


     StringBuilder serverIdentifier = new StringBuilder(64); // 64 
characters ought to be enough for anybody


     String protocol = getProtocol();
     if(null == protocol) {
     protocol = httpRequest.getProtocol();

     if(null != protocol) {
     if(!getIncludeProtocolName()) {
     int pos = protocol.indexOf('/');
     if(0 <= pos) {
     protocol = protocol.substring(pos + 1);
     }
     }
     serverIdentifier.append(protocol);
     }
     } else {
     serverIdentifier.append(protocol);
     }

     String serverName = getServerName();
     if(null == serverName) {
     serverName = getTrimmedIPAddress(httpRequest.getLocalAddr());
     }

     serverIdentifier.append(' ').append(serverName);

     if(getIncludePort()) {

serverIdentifier.append(':').append(httpRequest.getLocalPort());
     }

     httpResponse.addHeader(getHeaderName(), 
serverIdentifier.toString());


Most of the stuff has reasonable defaults. If you installed this on 
localhost IPv4 and didn't override anything, you'd get "Via: HTTP/1.1 1" 
i the response header because the IP address 127.0.0.1 would have all 
but the last octet of the address removed, leaving just the "1". This is 
pretty useless for localhost, but in a subnet with multiple backends, 
you'd get e.g. "Via: HTTP/1.1 42" and "Via HTTP/1.1 43" for servers on 
x.x.x.42 and x.x.x.43 

Buildbot success in on tomcat-9.0.x

2023-06-13 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/593
Blamelist: Mark Thomas , Michael Osipov 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 9.0.x] 10701043138222cc73465ec2c199ea7c3e94265f


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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



[Bug 59232] Make the context name of an app available via JNDI

2023-06-13 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=59232

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Mark Thomas  ---
Fixed via #624 and back-ports.

Fixed in:
- 11.0.x for 11.0.0-M8 onwards
- 10.1.x for 10.1.11 onwards
-  9.0.x for  9.0.77 onwards
-  8.5.x for  8.5.91 onwards

-- 
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



Buildbot failure in on tomcat-9.0.x

2023-06-13 Thread buildbot
Build status: BUILD FAILED: failed compile (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/592
Blamelist: Michael Osipov 
Build Text: failed compile (failure)
Status Detected: new failure
Build Source Stamp: [branch 9.0.x] 594a878ec4a566a463259a92536b3228af0d2999


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 2

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


-
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: Fix IDE warnings

2023-06-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 4a1c7ddfaa Fix IDE warnings
4a1c7ddfaa is described below

commit 4a1c7ddfaa89d48700d80ddd240a99f4589f8bc2
Author: Mark Thomas 
AuthorDate: Tue Jun 13 12:00:42 2023 +0100

Fix IDE warnings
---
 .../apache/catalina/core/TestContextNamingInfoListener.java  | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/core/TestContextNamingInfoListener.java 
b/test/org/apache/catalina/core/TestContextNamingInfoListener.java
index 875d0a574f..65f1d47e0a 100644
--- a/test/org/apache/catalina/core/TestContextNamingInfoListener.java
+++ b/test/org/apache/catalina/core/TestContextNamingInfoListener.java
@@ -16,17 +16,17 @@
  */
 package org.apache.catalina.core;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameter;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
 import org.apache.catalina.Context;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.deploy.NamingResourcesImpl;
@@ -67,7 +67,7 @@ public class TestContextNamingInfoListener extends 
TomcatBaseTest {
 @Parameter(2)
 public String displayName;
 @Parameter(3)
-public Boolean emptyOnRoot;
+public boolean emptyOnRoot;
 @Parameter(4)
 public String expectedContextPath;
 @Parameter(5)


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



[tomcat] branch 9.0.x updated: Fix IDE warnings

2023-06-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 1070104313 Fix IDE warnings
1070104313 is described below

commit 10701043138222cc73465ec2c199ea7c3e94265f
Author: Mark Thomas 
AuthorDate: Tue Jun 13 12:00:42 2023 +0100

Fix IDE warnings
---
 .../apache/catalina/core/TestContextNamingInfoListener.java  | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/core/TestContextNamingInfoListener.java 
b/test/org/apache/catalina/core/TestContextNamingInfoListener.java
index 875d0a574f..65f1d47e0a 100644
--- a/test/org/apache/catalina/core/TestContextNamingInfoListener.java
+++ b/test/org/apache/catalina/core/TestContextNamingInfoListener.java
@@ -16,17 +16,17 @@
  */
 package org.apache.catalina.core;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameter;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
 import org.apache.catalina.Context;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.deploy.NamingResourcesImpl;
@@ -67,7 +67,7 @@ public class TestContextNamingInfoListener extends 
TomcatBaseTest {
 @Parameter(2)
 public String displayName;
 @Parameter(3)
-public Boolean emptyOnRoot;
+public boolean emptyOnRoot;
 @Parameter(4)
 public String expectedContextPath;
 @Parameter(5)


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



[tomcat] branch 10.1.x updated: Fix IDE warnings

2023-06-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new b84f55f81d Fix IDE warnings
b84f55f81d is described below

commit b84f55f81d8e28ae5c2020c239509ed217123886
Author: Mark Thomas 
AuthorDate: Tue Jun 13 12:00:42 2023 +0100

Fix IDE warnings
---
 .../apache/catalina/core/TestContextNamingInfoListener.java  | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/core/TestContextNamingInfoListener.java 
b/test/org/apache/catalina/core/TestContextNamingInfoListener.java
index 875d0a574f..65f1d47e0a 100644
--- a/test/org/apache/catalina/core/TestContextNamingInfoListener.java
+++ b/test/org/apache/catalina/core/TestContextNamingInfoListener.java
@@ -16,17 +16,17 @@
  */
 package org.apache.catalina.core;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameter;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
 import org.apache.catalina.Context;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.deploy.NamingResourcesImpl;
@@ -67,7 +67,7 @@ public class TestContextNamingInfoListener extends 
TomcatBaseTest {
 @Parameter(2)
 public String displayName;
 @Parameter(3)
-public Boolean emptyOnRoot;
+public boolean emptyOnRoot;
 @Parameter(4)
 public String expectedContextPath;
 @Parameter(5)


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



[tomcat] branch main updated: Fix IDE warnings

2023-06-13 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
 new 1224267edd Fix IDE warnings
1224267edd is described below

commit 1224267eddb4907905ca5145f2a2e660e3a08100
Author: Mark Thomas 
AuthorDate: Tue Jun 13 12:00:42 2023 +0100

Fix IDE warnings
---
 .../apache/catalina/core/TestContextNamingInfoListener.java  | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/core/TestContextNamingInfoListener.java 
b/test/org/apache/catalina/core/TestContextNamingInfoListener.java
index 875d0a574f..65f1d47e0a 100644
--- a/test/org/apache/catalina/core/TestContextNamingInfoListener.java
+++ b/test/org/apache/catalina/core/TestContextNamingInfoListener.java
@@ -16,17 +16,17 @@
  */
 package org.apache.catalina.core;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameter;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
 import org.apache.catalina.Context;
 import org.apache.catalina.LifecycleState;
 import org.apache.catalina.deploy.NamingResourcesImpl;
@@ -67,7 +67,7 @@ public class TestContextNamingInfoListener extends 
TomcatBaseTest {
 @Parameter(2)
 public String displayName;
 @Parameter(3)
-public Boolean emptyOnRoot;
+public boolean emptyOnRoot;
 @Parameter(4)
 public String expectedContextPath;
 @Parameter(5)


-
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: Add ContextNamingInfoListener

2023-06-13 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new ed1277b29b Add ContextNamingInfoListener
ed1277b29b is described below

commit ed1277b29b6b017059bb101030e4cddb6ccd0d8c
Author: Michael Osipov 
AuthorDate: Thu Jun 8 12:09:15 2023 +0200

Add ContextNamingInfoListener

A listener which creates context naming information environment entries.
---
 .../catalina/core/ContextNamingInfoListener.java   | 121 +
 .../apache/catalina/core/LocalStrings.properties   |   3 +
 .../core/TestContextNamingInfoListener.java| 119 
 webapps/docs/changelog.xml |   5 +
 webapps/docs/config/listeners.xml  |  27 +
 5 files changed, 275 insertions(+)

diff --git a/java/org/apache/catalina/core/ContextNamingInfoListener.java 
b/java/org/apache/catalina/core/ContextNamingInfoListener.java
new file mode 100644
index 00..b77915c7d7
--- /dev/null
+++ b/java/org/apache/catalina/core/ContextNamingInfoListener.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.core;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.descriptor.web.ContextEnvironment;
+import org.apache.tomcat.util.res.StringManager;
+
+/**
+ *  Implementation of {@code LifecycleListener} that will create context 
naming information
+ *  environment entries.
+ * 
+ * This listener must only be nested within {@link Context} elements.
+ * 
+ * The following entries will be added to the initial context ({@code 
java:comp/env} implied):
+ * 
+ * Path: {@code context/path} from {@link Context#getPath()}
+ * Encoded Path: {@code context/encodedPath} from {@link 
Context#getEncodedPath()}
+ * Webapp Version: {@code context/webappVersion} from {@link 
Context#getWebappVersion()}
+ * Name: {@code context/name} from {@link Context#getName()}
+ * Base Name: {@code context/baseName} from {@link 
Context#getBaseName()}
+ * Display Name: {@code context/displayName} from {@link 
Context#getDisplayName()}
+ * 
+ * 
+ * See the https://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Naming;>Tomcat
+ * documentation for more details on the values.
+ */
+public class ContextNamingInfoListener implements LifecycleListener {
+
+private static final String PATH_ENTRY_NAME = "context/path";
+private static final String ENCODED_PATH_ENTRY_NAME = 
"context/encodedPath";
+private static final String WEBAPP_VERSION_ENTRY_NAME = 
"context/webappVersion";
+private static final String NAME_ENTRY_NAME = "context/name";
+private static final String BASE_NAME_ENTRY_NAME = "context/baseName";
+private static final String DISPLAY_NAME_ENTRY_NAME = 
"context/displayName";
+
+private static final Log log = 
LogFactory.getLog(ContextNamingInfoListener.class);
+/**
+ * The string manager for this package.
+ */
+private static final StringManager sm = 
StringManager.getManager(ContextNamingInfoListener.class);
+
+private boolean emptyOnRoot = true;
+
+/**
+ * Sets whether for the root context {@code context/path} and {@code 
context/encodedPath} will
+ * contain {@code "/"} and {@code context/name} will contain {@code 
"ROOT"} with a version, if any.
+ *
+ * @param emptyOnRoot whether paths and name for root context shall be 
empty
+ */
+public void setEmptyOnRoot(boolean emptyOnRoot) {
+this.emptyOnRoot = emptyOnRoot;
+}
+
+/**
+ * Gets whether paths and name for the root context will be empty.
+ *
+ * @return indicator whether paths and name for the root context will be 
empty
+ */
+public boolean isEmptyOnRoot() {
+return emptyOnRoot;
+}
+
+@Override
+public void lifecycleEvent(LifecycleEvent event) {
+if 

[tomcat] branch 9.0.x updated: Add ContextNamingInfoListener

2023-06-13 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 594a878ec4 Add ContextNamingInfoListener
594a878ec4 is described below

commit 594a878ec4a566a463259a92536b3228af0d2999
Author: Michael Osipov 
AuthorDate: Thu Jun 8 12:09:15 2023 +0200

Add ContextNamingInfoListener

A listener which creates context naming information environment entries.
---
 .../catalina/core/ContextNamingInfoListener.java   | 121 +
 .../apache/catalina/core/LocalStrings.properties   |   3 +
 .../core/TestContextNamingInfoListener.java| 119 
 webapps/docs/changelog.xml |   5 +
 webapps/docs/config/listeners.xml  |  27 +
 5 files changed, 275 insertions(+)

diff --git a/java/org/apache/catalina/core/ContextNamingInfoListener.java 
b/java/org/apache/catalina/core/ContextNamingInfoListener.java
new file mode 100644
index 00..0e1926877b
--- /dev/null
+++ b/java/org/apache/catalina/core/ContextNamingInfoListener.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.core;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.descriptor.web.ContextEnvironment;
+import org.apache.tomcat.util.res.StringManager;
+
+/**
+ *  Implementation of {@code LifecycleListener} that will create context 
naming information
+ *  environment entries.
+ * 
+ * This listener must only be nested within {@link Context} elements.
+ * 
+ * The following entries will be added to the initial context ({@code 
java:comp/env} implied):
+ * 
+ * Path: {@code context/path} from {@link Context#getPath()}
+ * Encoded Path: {@code context/encodedPath} from {@link 
Context#getEncodedPath()}
+ * Webapp Version: {@code context/webappVersion} from {@link 
Context#getWebappVersion()}
+ * Name: {@code context/name} from {@link Context#getName()}
+ * Base Name: {@code context/baseName} from {@link 
Context#getBaseName()}
+ * Display Name: {@code context/displayName} from {@link 
Context#getDisplayName()}
+ * 
+ * 
+ * See the https://tomcat.apache.org/tomcat-9.0-doc/config/context.html#Naming;>Tomcat
+ * documentation for more details on the values.
+ */
+public class ContextNamingInfoListener implements LifecycleListener {
+
+private static final String PATH_ENTRY_NAME = "context/path";
+private static final String ENCODED_PATH_ENTRY_NAME = 
"context/encodedPath";
+private static final String WEBAPP_VERSION_ENTRY_NAME = 
"context/webappVersion";
+private static final String NAME_ENTRY_NAME = "context/name";
+private static final String BASE_NAME_ENTRY_NAME = "context/baseName";
+private static final String DISPLAY_NAME_ENTRY_NAME = 
"context/displayName";
+
+private static final Log log = 
LogFactory.getLog(ContextNamingInfoListener.class);
+/**
+ * The string manager for this package.
+ */
+private static final StringManager sm = 
StringManager.getManager(ContextNamingInfoListener.class);
+
+private boolean emptyOnRoot = true;
+
+/**
+ * Sets whether for the root context {@code context/path} and {@code 
context/encodedPath} will
+ * contain {@code "/"} and {@code context/name} will contain {@code 
"ROOT"} with a version, if any.
+ *
+ * @param emptyOnRoot whether paths and name for root context shall be 
empty
+ */
+public void setEmptyOnRoot(boolean emptyOnRoot) {
+this.emptyOnRoot = emptyOnRoot;
+}
+
+/**
+ * Gets whether paths and name for the root context will be empty.
+ *
+ * @return indicator whether paths and name for the root context will be 
empty
+ */
+public boolean isEmptyOnRoot() {
+return emptyOnRoot;
+}
+
+@Override
+public void lifecycleEvent(LifecycleEvent event) {
+if 

[tomcat] branch 10.1.x updated: Add ContextNamingInfoListener

2023-06-13 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 966ba70198 Add ContextNamingInfoListener
966ba70198 is described below

commit 966ba701982d2779bed3246adc4e48b70971400b
Author: Michael Osipov 
AuthorDate: Thu Jun 8 12:09:15 2023 +0200

Add ContextNamingInfoListener

A listener which creates context naming information environment entries.
---
 .../catalina/core/ContextNamingInfoListener.java   | 121 +
 .../apache/catalina/core/LocalStrings.properties   |   3 +
 .../core/TestContextNamingInfoListener.java| 119 
 webapps/docs/changelog.xml |   5 +
 webapps/docs/config/listeners.xml  |  27 +
 5 files changed, 275 insertions(+)

diff --git a/java/org/apache/catalina/core/ContextNamingInfoListener.java 
b/java/org/apache/catalina/core/ContextNamingInfoListener.java
new file mode 100644
index 00..cf0db7f8ed
--- /dev/null
+++ b/java/org/apache/catalina/core/ContextNamingInfoListener.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.core;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.descriptor.web.ContextEnvironment;
+import org.apache.tomcat.util.res.StringManager;
+
+/**
+ *  Implementation of {@code LifecycleListener} that will create context 
naming information
+ *  environment entries.
+ * 
+ * This listener must only be nested within {@link Context} elements.
+ * 
+ * The following entries will be added to the initial context ({@code 
java:comp/env} implied):
+ * 
+ * Path: {@code context/path} from {@link Context#getPath()}
+ * Encoded Path: {@code context/encodedPath} from {@link 
Context#getEncodedPath()}
+ * Webapp Version: {@code context/webappVersion} from {@link 
Context#getWebappVersion()}
+ * Name: {@code context/name} from {@link Context#getName()}
+ * Base Name: {@code context/baseName} from {@link 
Context#getBaseName()}
+ * Display Name: {@code context/displayName} from {@link 
Context#getDisplayName()}
+ * 
+ * 
+ * See the https://tomcat.apache.org/tomcat-10.1-doc/config/context.html#Naming;>Tomcat
+ * documentation for more details on the values.
+ */
+public class ContextNamingInfoListener implements LifecycleListener {
+
+private static final String PATH_ENTRY_NAME = "context/path";
+private static final String ENCODED_PATH_ENTRY_NAME = 
"context/encodedPath";
+private static final String WEBAPP_VERSION_ENTRY_NAME = 
"context/webappVersion";
+private static final String NAME_ENTRY_NAME = "context/name";
+private static final String BASE_NAME_ENTRY_NAME = "context/baseName";
+private static final String DISPLAY_NAME_ENTRY_NAME = 
"context/displayName";
+
+private static final Log log = 
LogFactory.getLog(ContextNamingInfoListener.class);
+/**
+ * The string manager for this package.
+ */
+private static final StringManager sm = 
StringManager.getManager(ContextNamingInfoListener.class);
+
+private boolean emptyOnRoot = true;
+
+/**
+ * Sets whether for the root context {@code context/path} and {@code 
context/encodedPath} will
+ * contain {@code "/"} and {@code context/name} will contain {@code 
"ROOT"} with a version, if any.
+ *
+ * @param emptyOnRoot whether paths and name for root context shall be 
empty
+ */
+public void setEmptyOnRoot(boolean emptyOnRoot) {
+this.emptyOnRoot = emptyOnRoot;
+}
+
+/**
+ * Gets whether paths and name for the root context will be empty.
+ *
+ * @return indicator whether paths and name for the root context will be 
empty
+ */
+public boolean isEmptyOnRoot() {
+return emptyOnRoot;
+}
+
+@Override
+public void lifecycleEvent(LifecycleEvent event) {
+if 

[tomcat] branch main updated (26e49bba4b -> f3adc26288)

2023-06-13 Thread michaelo
This is an automated email from the ASF dual-hosted git repository.

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


from 26e49bba4b Expand security guidance to cover embedded usage
 add f3adc26288 Add ContextNamingInfoListener

No new revisions were added by this update.

Summary of changes:
 .../catalina/core/ContextNamingInfoListener.java   | 121 +
 .../apache/catalina/core/LocalStrings.properties   |   3 +
 .../core/TestContextNamingInfoListener.java| 119 
 webapps/docs/changelog.xml |   5 +
 webapps/docs/config/listeners.xml  |  27 +
 5 files changed, 275 insertions(+)
 create mode 100644 java/org/apache/catalina/core/ContextNamingInfoListener.java
 create mode 100644 
test/org/apache/catalina/core/TestContextNamingInfoListener.java


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



[GitHub] [tomcat] michael-o merged pull request #624: Add ContextNamingInfoListener

2023-06-13 Thread via GitHub


michael-o merged PR #624:
URL: https://github.com/apache/tomcat/pull/624


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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] markt-asf commented on pull request #624: Add ContextNamingInfoListener

2023-06-13 Thread via GitHub


markt-asf commented on PR #624:
URL: https://github.com/apache/tomcat/pull/624#issuecomment-1588774994

   LGTM


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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] michael-o commented on pull request #624: Add ContextNamingInfoListener

2023-06-13 Thread via GitHub


michael-o commented on PR #624:
URL: https://github.com/apache/tomcat/pull/624#issuecomment-1588662647

   > No problem. I don't really mind the default value, it could go either way.
   
   Great, if there aren't any objections I will happily merge later this day.


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

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