diff --git a/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/odata/ODataServiceHandler.java b/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/odata/ODataServiceHandler.java index ffb2732f15..4adcb58aa5 100644 --- a/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/odata/ODataServiceHandler.java +++ b/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/odata/ODataServiceHandler.java @@ -219,6 +219,10 @@ public HttpSession getSession(boolean b) { @Override public HttpSession getSession() { + HttpSession oldSession = getSession(false); + if (oldSession != null) { + oldSession.invalidate(); + } return req.getSession(); } diff --git a/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/odata/RDBMSDataHandler.java b/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/odata/RDBMSDataHandler.java index 74fadea5fd..43dbc06c72 100644 --- a/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/odata/RDBMSDataHandler.java +++ b/components/data/data-services/org.wso2.micro.integrator.dataservices.core/src/main/java/org/wso2/micro/integrator/dataservices/core/odata/RDBMSDataHandler.java @@ -34,6 +34,7 @@ import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.math.BigDecimal; @@ -831,8 +832,11 @@ private void bindValuesToPreparedStatement(int type, String value, int ordinalPo if (value == null) { sqlStatement.setNull(ordinalPosition, type); } else { - sqlStatement.setClob(ordinalPosition, new BufferedReader(new StringReader(value)), - value.length()); + try (BufferedReader reader = new BufferedReader(new StringReader(value))) { + sqlStatement.setClob(ordinalPosition, reader, value.length()); + } catch (IOException e) { + sqlStatement.setNull(ordinalPosition, type); + } } break; case Types.BOOLEAN: @@ -911,8 +915,11 @@ private void bindValuesToPreparedStatement(int type, String value, int ordinalPo if (value == null) { sqlStatement.setNull(ordinalPosition, type); } else { - sqlStatement.setNClob(ordinalPosition, new BufferedReader(new StringReader(value)), - value.length()); + try (BufferedReader reader = new BufferedReader(new StringReader(value))) { + sqlStatement.setNClob(ordinalPosition, reader, value.length()); + } catch (IOException e) { + sqlStatement.setNull(ordinalPosition, type); + } } break; case Types.BIGINT: diff --git a/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/websocket/ssl/SSLHandlerFactory.java b/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/websocket/ssl/SSLHandlerFactory.java index 628c610aab..94d02c0653 100644 --- a/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/websocket/ssl/SSLHandlerFactory.java +++ b/components/mediation/inbound-endpoints/org.wso2.micro.integrator.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/websocket/ssl/SSLHandlerFactory.java @@ -40,7 +40,7 @@ public class SSLHandlerFactory { - private static final String protocol = "TLS"; + private static final String protocol = "TLSv1.2"; private final SSLContext serverContext; private boolean needClientAuth; private String[] cipherSuites; diff --git a/components/org.wso2.micro.integrator.core/src/main/java/org/wso2/micro/core/encryption/KeyStoreBasedExternalCryptoProvider.java b/components/org.wso2.micro.integrator.core/src/main/java/org/wso2/micro/core/encryption/KeyStoreBasedExternalCryptoProvider.java index 701bbfcfea..bb4e50c055 100644 --- a/components/org.wso2.micro.integrator.core/src/main/java/org/wso2/micro/core/encryption/KeyStoreBasedExternalCryptoProvider.java +++ b/components/org.wso2.micro.integrator.core/src/main/java/org/wso2/micro/core/encryption/KeyStoreBasedExternalCryptoProvider.java @@ -562,8 +562,9 @@ private byte[] symmetricDecryptData(HybridEncryptionOutput hybridEncryptionOutpu } if ((hybridEncryptionOutput.getAuthData() != null) && (hybridEncryptionOutput.getAuthTag() != null)) { cipher.updateAAD(hybridEncryptionOutput.getAuthData()); - return cipher.doFinal(concatByteArrays( - new byte[][] { hybridEncryptionOutput.getCipherData(), hybridEncryptionOutput.getAuthTag() })); + byte[] encryptedDataWithTag = concatByteArrays( + new byte[][] { hybridEncryptionOutput.getCipherData(), hybridEncryptionOutput.getAuthTag() }); + return cipher.doFinal(encryptedDataWithTag); } else { return cipher.doFinal(hybridEncryptionOutput.getCipherData()); } diff --git a/components/org.wso2.micro.integrator.core/src/main/java/org/wso2/micro/core/transports/metering/MeteredServletRequest.java b/components/org.wso2.micro.integrator.core/src/main/java/org/wso2/micro/core/transports/metering/MeteredServletRequest.java index 35467a7344..a1a24ea90d 100644 --- a/components/org.wso2.micro.integrator.core/src/main/java/org/wso2/micro/core/transports/metering/MeteredServletRequest.java +++ b/components/org.wso2.micro.integrator.core/src/main/java/org/wso2/micro/core/transports/metering/MeteredServletRequest.java @@ -123,6 +123,10 @@ public String getServletPath() { } public HttpSession getSession() { + HttpSession oldSession = getSession(false); + if (oldSession != null) { + oldSession.invalidate(); + } return wrappedHttpServletRequest.getSession(); }