Skip to content

Commit

Permalink
Update pki-servlet-engine/tomcat dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Nov 28, 2023
1 parent 1b7a495 commit 60a64fc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/org/dogtagpki/tomcat/JSSNioEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class JSSNioEndpoint extends NioEndpoint {
/**
* Code in the following method is almost identical of that available in the base
* class {@link org.apache.tomcat.util.net.NioEndpoint#setSocketOptions(SocketChannel) from tomcat
* git repository for the version 9.0.30.
* git repository for the version 9.0.59.
* <p>
* The only difference is the instantiation of the JSSSecureNioChannel class instead of the tomcat
* provided SecureNioChannel class. This is needed because the channel class is hard-coded in the
Expand All @@ -87,7 +87,7 @@ protected boolean setSocketOptions(SocketChannel socket) {
socketProperties.getDirectBuffer());
if (isSSLEnabled()) {
// This is the change from the code in the base class
channel = new JSSSecureNioChannel(bufhandler, getSelectorPool(), this);
channel = new JSSSecureNioChannel(bufhandler, this);
// End of difference
} else {
channel = new NioChannel(bufhandler);
Expand All @@ -106,7 +106,7 @@ protected boolean setSocketOptions(SocketChannel socket) {
socketWrapper.setReadTimeout(getConnectionTimeout());
socketWrapper.setWriteTimeout(getConnectionTimeout());
socketWrapper.setKeepAliveLeft(JSSNioEndpoint.this.getMaxKeepAliveRequests());
getPoller().register(channel, socketWrapper);
getPoller().register(socketWrapper);
return true;
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,12 @@
import javax.net.ssl.SSLEngineResult.HandshakeStatus;
import javax.net.ssl.SSLEngineResult.Status;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSession;

import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.buf.ByteBufferUtils;
import org.apache.tomcat.util.compat.JreCompat;
import org.apache.tomcat.util.net.NioEndpoint;
import org.apache.tomcat.util.net.NioSelectorPool;
import org.apache.tomcat.util.net.SSLSupport;
import org.apache.tomcat.util.net.SSLUtil;
import org.apache.tomcat.util.net.SecureNioChannel;
import org.apache.tomcat.util.net.SocketBufferHandler;
Expand All @@ -74,7 +71,7 @@
* <p>
* Code in the following methods are almost identical of that available in the base
* class {@link org.apache.tomcat.util.net.SecureNioChannel from tomcat git repository
* for the version 9.0.30.
* for the version 9.0.59.
* <p>
* The only difference is the registration of local and remote IP in the SSL engine session.
* These IPs are required for audit purpose but the tomcat implementation does not provide
Expand All @@ -95,8 +92,8 @@ public class JSSSecureNioChannel extends SecureNioChannel {

private final Map<String,List<String>> additionalTlsAttributes = new HashMap<>();

public JSSSecureNioChannel(SocketBufferHandler bufHandler, NioSelectorPool pool, NioEndpoint endpoint) {
super(bufHandler, pool, endpoint);
public JSSSecureNioChannel(SocketBufferHandler bufHandler, NioEndpoint endpoint) {
super(bufHandler, endpoint);
this.endpoint = (JSSNioEndpoint) endpoint;
}

Expand Down
10 changes: 7 additions & 3 deletions tomcatjss.spec
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ BuildRequires: slf4j-jdk14
BuildRequires: jss = 4.9

# Tomcat
BuildRequires: tomcat >= 1:9.0.7, tomcat < 1:9.0.40
%if 0%{?rhel} && ! 0%{?eln}
BuildRequires: pki-servlet-engine >= 9.0.50
%else
BuildRequires: tomcat >= 9.0.50
%endif

################################################################################
# Runtime Dependencies
Expand All @@ -92,9 +96,9 @@ Requires: jss = 4.9

# Tomcat
%if 0%{?rhel} && ! 0%{?eln}
Requires: pki-servlet-engine >= 1:9.0.7, pki-servlet-engine < 1:9.0.40
Requires: pki-servlet-engine >= 9.0.50
%else
Requires: tomcat >= 1:9.0.7, tomcat < 1:9.0.40
Requires: tomcat >= 9.0.50
%endif

Provides: tomcatjss = %{major_version}.%{minor_version}
Expand Down

0 comments on commit 60a64fc

Please sign in to comment.