diff --git a/android/pom.xml b/android/pom.xml index 06ef1f4e2..337189629 100644 --- a/android/pom.xml +++ b/android/pom.xml @@ -14,17 +14,29 @@ GeneXus Standard Classes for Android - - ${project.groupId} - gxcryptocommon - ${project.version} - ${project.groupId} gxcommon ${project.version} + + + org.apache.httpcomponents + httpclient + + - + + ${project.groupId} + gxcryptocommon + ${project.version} + + + org.apache.httpcomponents + httpclient + + + + org.locationtech.spatial4j spatial4j 0.7 diff --git a/common/src/main/java/HTTPClient/AuthSchemeNotImplException.java b/android/src/main/java/HTTPClient/AuthSchemeNotImplException.java similarity index 100% rename from common/src/main/java/HTTPClient/AuthSchemeNotImplException.java rename to android/src/main/java/HTTPClient/AuthSchemeNotImplException.java diff --git a/common/src/main/java/HTTPClient/AuthorizationHandler.java b/android/src/main/java/HTTPClient/AuthorizationHandler.java similarity index 100% rename from common/src/main/java/HTTPClient/AuthorizationHandler.java rename to android/src/main/java/HTTPClient/AuthorizationHandler.java diff --git a/common/src/main/java/HTTPClient/AuthorizationInfo.java b/android/src/main/java/HTTPClient/AuthorizationInfo.java similarity index 100% rename from common/src/main/java/HTTPClient/AuthorizationInfo.java rename to android/src/main/java/HTTPClient/AuthorizationInfo.java diff --git a/common/src/main/java/HTTPClient/AuthorizationModule.java b/android/src/main/java/HTTPClient/AuthorizationModule.java similarity index 100% rename from common/src/main/java/HTTPClient/AuthorizationModule.java rename to android/src/main/java/HTTPClient/AuthorizationModule.java diff --git a/common/src/main/java/HTTPClient/AuthorizationPrompter.java b/android/src/main/java/HTTPClient/AuthorizationPrompter.java similarity index 100% rename from common/src/main/java/HTTPClient/AuthorizationPrompter.java rename to android/src/main/java/HTTPClient/AuthorizationPrompter.java diff --git a/common/src/main/java/HTTPClient/BufferedInputStream.java b/android/src/main/java/HTTPClient/BufferedInputStream.java similarity index 100% rename from common/src/main/java/HTTPClient/BufferedInputStream.java rename to android/src/main/java/HTTPClient/BufferedInputStream.java diff --git a/common/src/main/java/HTTPClient/CIHashtable.java b/android/src/main/java/HTTPClient/CIHashtable.java similarity index 100% rename from common/src/main/java/HTTPClient/CIHashtable.java rename to android/src/main/java/HTTPClient/CIHashtable.java diff --git a/common/src/main/java/HTTPClient/ChunkedInputStream.java b/android/src/main/java/HTTPClient/ChunkedInputStream.java similarity index 100% rename from common/src/main/java/HTTPClient/ChunkedInputStream.java rename to android/src/main/java/HTTPClient/ChunkedInputStream.java diff --git a/common/src/main/java/HTTPClient/Codecs.java b/android/src/main/java/HTTPClient/Codecs.java similarity index 100% rename from common/src/main/java/HTTPClient/Codecs.java rename to android/src/main/java/HTTPClient/Codecs.java diff --git a/common/src/main/java/HTTPClient/ContentEncodingModule.java b/android/src/main/java/HTTPClient/ContentEncodingModule.java similarity index 100% rename from common/src/main/java/HTTPClient/ContentEncodingModule.java rename to android/src/main/java/HTTPClient/ContentEncodingModule.java diff --git a/common/src/main/java/HTTPClient/ContentMD5Module.java b/android/src/main/java/HTTPClient/ContentMD5Module.java similarity index 100% rename from common/src/main/java/HTTPClient/ContentMD5Module.java rename to android/src/main/java/HTTPClient/ContentMD5Module.java diff --git a/common/src/main/java/HTTPClient/Cookie.java b/android/src/main/java/HTTPClient/Cookie.java similarity index 100% rename from common/src/main/java/HTTPClient/Cookie.java rename to android/src/main/java/HTTPClient/Cookie.java diff --git a/common/src/main/java/HTTPClient/Cookie2.java b/android/src/main/java/HTTPClient/Cookie2.java similarity index 100% rename from common/src/main/java/HTTPClient/Cookie2.java rename to android/src/main/java/HTTPClient/Cookie2.java diff --git a/common/src/main/java/HTTPClient/CookieModule.java b/android/src/main/java/HTTPClient/CookieModule.java similarity index 97% rename from common/src/main/java/HTTPClient/CookieModule.java rename to android/src/main/java/HTTPClient/CookieModule.java index 8e4dcb100..08d9c7b0f 100644 --- a/common/src/main/java/HTTPClient/CookieModule.java +++ b/android/src/main/java/HTTPClient/CookieModule.java @@ -11,23 +11,6 @@ import java.util.Hashtable; import java.util.Enumeration; -import java.awt.Frame; -import java.awt.Panel; -import java.awt.Label; -import java.awt.Color; -import java.awt.Button; -import java.awt.Graphics; -import java.awt.Dimension; -import java.awt.TextArea; -import java.awt.TextField; -import java.awt.GridLayout; -import java.awt.GridBagLayout; -import java.awt.GridBagConstraints; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowEvent; -import java.awt.event.WindowAdapter; - /** * This module handles Netscape cookies (also called Version 0 cookies) diff --git a/common/src/main/java/HTTPClient/CookiePolicyHandler.java b/android/src/main/java/HTTPClient/CookiePolicyHandler.java similarity index 100% rename from common/src/main/java/HTTPClient/CookiePolicyHandler.java rename to android/src/main/java/HTTPClient/CookiePolicyHandler.java diff --git a/common/src/main/java/HTTPClient/DESAlgorithm.java b/android/src/main/java/HTTPClient/DESAlgorithm.java similarity index 100% rename from common/src/main/java/HTTPClient/DESAlgorithm.java rename to android/src/main/java/HTTPClient/DESAlgorithm.java diff --git a/common/src/main/java/HTTPClient/DefaultAuthHandler.java b/android/src/main/java/HTTPClient/DefaultAuthHandler.java similarity index 99% rename from common/src/main/java/HTTPClient/DefaultAuthHandler.java rename to android/src/main/java/HTTPClient/DefaultAuthHandler.java index 15aca454e..9706e009e 100644 --- a/common/src/main/java/HTTPClient/DefaultAuthHandler.java +++ b/android/src/main/java/HTTPClient/DefaultAuthHandler.java @@ -9,21 +9,6 @@ import java.util.Vector; import java.util.StringTokenizer; -import java.awt.Frame; -import java.awt.Panel; -import java.awt.Label; -import java.awt.Button; -import java.awt.Dimension; -import java.awt.TextField; -import java.awt.GridLayout; -import java.awt.BorderLayout; -import java.awt.GridBagLayout; -import java.awt.GridBagConstraints; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowEvent; -import java.awt.event.WindowAdapter; - /** * This class is the default authorization handler. It currently handles the * authentication schemes "Basic", "Digest", and "SOCKS5" (used for the diff --git a/common/src/main/java/HTTPClient/DefaultModule.java b/android/src/main/java/HTTPClient/DefaultModule.java similarity index 100% rename from common/src/main/java/HTTPClient/DefaultModule.java rename to android/src/main/java/HTTPClient/DefaultModule.java diff --git a/common/src/main/java/HTTPClient/DefaultSSLConnection.java b/android/src/main/java/HTTPClient/DefaultSSLConnection.java similarity index 100% rename from common/src/main/java/HTTPClient/DefaultSSLConnection.java rename to android/src/main/java/HTTPClient/DefaultSSLConnection.java diff --git a/common/src/main/java/HTTPClient/FileConnection.java b/android/src/main/java/HTTPClient/FileConnection.java similarity index 100% rename from common/src/main/java/HTTPClient/FileConnection.java rename to android/src/main/java/HTTPClient/FileConnection.java diff --git a/common/src/main/java/HTTPClient/FilenameMangler.java b/android/src/main/java/HTTPClient/FilenameMangler.java similarity index 100% rename from common/src/main/java/HTTPClient/FilenameMangler.java rename to android/src/main/java/HTTPClient/FilenameMangler.java diff --git a/common/src/main/java/HTTPClient/GlobalConstants.java b/android/src/main/java/HTTPClient/GlobalConstants.java similarity index 100% rename from common/src/main/java/HTTPClient/GlobalConstants.java rename to android/src/main/java/HTTPClient/GlobalConstants.java diff --git a/common/src/main/java/HTTPClient/HTTPClientModule.java b/android/src/main/java/HTTPClient/HTTPClientModule.java similarity index 100% rename from common/src/main/java/HTTPClient/HTTPClientModule.java rename to android/src/main/java/HTTPClient/HTTPClientModule.java diff --git a/common/src/main/java/HTTPClient/HTTPClientModuleConstants.java b/android/src/main/java/HTTPClient/HTTPClientModuleConstants.java similarity index 100% rename from common/src/main/java/HTTPClient/HTTPClientModuleConstants.java rename to android/src/main/java/HTTPClient/HTTPClientModuleConstants.java diff --git a/common/src/main/java/HTTPClient/HTTPConnection.java b/android/src/main/java/HTTPClient/HTTPConnection.java similarity index 99% rename from common/src/main/java/HTTPClient/HTTPConnection.java rename to android/src/main/java/HTTPClient/HTTPConnection.java index 0e22ee77b..ef3d443ba 100644 --- a/common/src/main/java/HTTPClient/HTTPConnection.java +++ b/android/src/main/java/HTTPClient/HTTPConnection.java @@ -47,10 +47,7 @@ import java.net.NoRouteToHostException; import java.util.Vector; -import com.genexus.common.interfaces.SpecificImplementation; - import java.util.StringTokenizer; -import java.applet.Applet; /** @@ -664,11 +661,11 @@ public static String descramble(String scrambled) * * @param applet the current applet */ - public HTTPConnection(Object applet) throws ProtocolNotSuppException - { - if (SpecificImplementation.HTTPConnection != null) - SpecificImplementation.HTTPConnection.createHttpConnectionFromApplet(applet, this); - } +// public HTTPConnection(Object applet) throws ProtocolNotSuppException +// { +// if (SpecificImplementation.HTTPConnection != null) +// SpecificImplementation.HTTPConnection.createHttpConnectionFromApplet(applet, this); +// } /** diff --git a/common/src/main/java/HTTPClient/HTTPResponse.java b/android/src/main/java/HTTPClient/HTTPResponse.java similarity index 100% rename from common/src/main/java/HTTPClient/HTTPResponse.java rename to android/src/main/java/HTTPClient/HTTPResponse.java diff --git a/common/src/main/java/HTTPClient/HashVerifier.java b/android/src/main/java/HTTPClient/HashVerifier.java similarity index 100% rename from common/src/main/java/HTTPClient/HashVerifier.java rename to android/src/main/java/HTTPClient/HashVerifier.java diff --git a/common/src/main/java/HTTPClient/HttpHeaderElement.java b/android/src/main/java/HTTPClient/HttpHeaderElement.java similarity index 100% rename from common/src/main/java/HTTPClient/HttpHeaderElement.java rename to android/src/main/java/HTTPClient/HttpHeaderElement.java diff --git a/common/src/main/java/HTTPClient/HttpOutputStream.java b/android/src/main/java/HTTPClient/HttpOutputStream.java similarity index 100% rename from common/src/main/java/HTTPClient/HttpOutputStream.java rename to android/src/main/java/HTTPClient/HttpOutputStream.java diff --git a/common/src/main/java/HTTPClient/HttpURLConnection.java b/android/src/main/java/HTTPClient/HttpURLConnection.java similarity index 100% rename from common/src/main/java/HTTPClient/HttpURLConnection.java rename to android/src/main/java/HTTPClient/HttpURLConnection.java diff --git a/common/src/main/java/HTTPClient/ISSLConnection.java b/android/src/main/java/HTTPClient/ISSLConnection.java similarity index 100% rename from common/src/main/java/HTTPClient/ISSLConnection.java rename to android/src/main/java/HTTPClient/ISSLConnection.java diff --git a/common/src/main/java/HTTPClient/IdempotentSequence.java b/android/src/main/java/HTTPClient/IdempotentSequence.java similarity index 100% rename from common/src/main/java/HTTPClient/IdempotentSequence.java rename to android/src/main/java/HTTPClient/IdempotentSequence.java diff --git a/common/src/main/java/HTTPClient/JSSESSLConnection.java b/android/src/main/java/HTTPClient/JSSESSLConnection.java similarity index 96% rename from common/src/main/java/HTTPClient/JSSESSLConnection.java rename to android/src/main/java/HTTPClient/JSSESSLConnection.java index fdf8e7aaf..6fbe0fbd7 100644 --- a/common/src/main/java/HTTPClient/JSSESSLConnection.java +++ b/android/src/main/java/HTTPClient/JSSESSLConnection.java @@ -7,9 +7,7 @@ import java.io.IOException; import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLException; import javax.net.ssl.SSLSocketFactory; -import javax.security.cert.X509Certificate; /** Esta clase provee un Binding SSL para la libreria JSSE de Sun * diff --git a/common/src/main/java/HTTPClient/LinkedList.java b/android/src/main/java/HTTPClient/LinkedList.java similarity index 100% rename from common/src/main/java/HTTPClient/LinkedList.java rename to android/src/main/java/HTTPClient/LinkedList.java diff --git a/common/src/main/java/HTTPClient/Log.java b/android/src/main/java/HTTPClient/Log.java similarity index 100% rename from common/src/main/java/HTTPClient/Log.java rename to android/src/main/java/HTTPClient/Log.java diff --git a/common/src/main/java/HTTPClient/MD4.java b/android/src/main/java/HTTPClient/MD4.java similarity index 99% rename from common/src/main/java/HTTPClient/MD4.java rename to android/src/main/java/HTTPClient/MD4.java index 29806da2f..6edd8ed48 100644 --- a/common/src/main/java/HTTPClient/MD4.java +++ b/android/src/main/java/HTTPClient/MD4.java @@ -28,8 +28,6 @@ package HTTPClient; -import java.io.FileInputStream; - /** * This class implements the MD4 hash as specified in RFC-1320. diff --git a/common/src/main/java/HTTPClient/MD5.java b/android/src/main/java/HTTPClient/MD5.java similarity index 100% rename from common/src/main/java/HTTPClient/MD5.java rename to android/src/main/java/HTTPClient/MD5.java diff --git a/common/src/main/java/HTTPClient/MD5InputStream.java b/android/src/main/java/HTTPClient/MD5InputStream.java similarity index 100% rename from common/src/main/java/HTTPClient/MD5InputStream.java rename to android/src/main/java/HTTPClient/MD5InputStream.java diff --git a/common/src/main/java/HTTPClient/ModuleException.java b/android/src/main/java/HTTPClient/ModuleException.java similarity index 100% rename from common/src/main/java/HTTPClient/ModuleException.java rename to android/src/main/java/HTTPClient/ModuleException.java diff --git a/common/src/main/java/HTTPClient/NVPair.java b/android/src/main/java/HTTPClient/NVPair.java similarity index 100% rename from common/src/main/java/HTTPClient/NVPair.java rename to android/src/main/java/HTTPClient/NVPair.java diff --git a/common/src/main/java/HTTPClient/ParseException.java b/android/src/main/java/HTTPClient/ParseException.java similarity index 100% rename from common/src/main/java/HTTPClient/ParseException.java rename to android/src/main/java/HTTPClient/ParseException.java diff --git a/common/src/main/java/HTTPClient/ProtocolNotSuppException.java b/android/src/main/java/HTTPClient/ProtocolNotSuppException.java similarity index 100% rename from common/src/main/java/HTTPClient/ProtocolNotSuppException.java rename to android/src/main/java/HTTPClient/ProtocolNotSuppException.java diff --git a/common/src/main/java/HTTPClient/RedirectionModule.java b/android/src/main/java/HTTPClient/RedirectionModule.java similarity index 100% rename from common/src/main/java/HTTPClient/RedirectionModule.java rename to android/src/main/java/HTTPClient/RedirectionModule.java diff --git a/common/src/main/java/HTTPClient/Request.java b/android/src/main/java/HTTPClient/Request.java similarity index 100% rename from common/src/main/java/HTTPClient/Request.java rename to android/src/main/java/HTTPClient/Request.java diff --git a/common/src/main/java/HTTPClient/RespInputStream.java b/android/src/main/java/HTTPClient/RespInputStream.java similarity index 100% rename from common/src/main/java/HTTPClient/RespInputStream.java rename to android/src/main/java/HTTPClient/RespInputStream.java diff --git a/common/src/main/java/HTTPClient/Response.java b/android/src/main/java/HTTPClient/Response.java similarity index 100% rename from common/src/main/java/HTTPClient/Response.java rename to android/src/main/java/HTTPClient/Response.java diff --git a/common/src/main/java/HTTPClient/ResponseHandler.java b/android/src/main/java/HTTPClient/ResponseHandler.java similarity index 100% rename from common/src/main/java/HTTPClient/ResponseHandler.java rename to android/src/main/java/HTTPClient/ResponseHandler.java diff --git a/common/src/main/java/HTTPClient/RetryException.java b/android/src/main/java/HTTPClient/RetryException.java similarity index 100% rename from common/src/main/java/HTTPClient/RetryException.java rename to android/src/main/java/HTTPClient/RetryException.java diff --git a/common/src/main/java/HTTPClient/RetryModule.java b/android/src/main/java/HTTPClient/RetryModule.java similarity index 100% rename from common/src/main/java/HTTPClient/RetryModule.java rename to android/src/main/java/HTTPClient/RetryModule.java diff --git a/common/src/main/java/HTTPClient/RoRequest.java b/android/src/main/java/HTTPClient/RoRequest.java similarity index 100% rename from common/src/main/java/HTTPClient/RoRequest.java rename to android/src/main/java/HTTPClient/RoRequest.java diff --git a/common/src/main/java/HTTPClient/RoResponse.java b/android/src/main/java/HTTPClient/RoResponse.java similarity index 100% rename from common/src/main/java/HTTPClient/RoResponse.java rename to android/src/main/java/HTTPClient/RoResponse.java diff --git a/common/src/main/java/HTTPClient/SSLManager.java b/android/src/main/java/HTTPClient/SSLManager.java similarity index 100% rename from common/src/main/java/HTTPClient/SSLManager.java rename to android/src/main/java/HTTPClient/SSLManager.java diff --git a/common/src/main/java/HTTPClient/SSLSocketException.java b/android/src/main/java/HTTPClient/SSLSocketException.java similarity index 100% rename from common/src/main/java/HTTPClient/SSLSocketException.java rename to android/src/main/java/HTTPClient/SSLSocketException.java diff --git a/common/src/main/java/HTTPClient/SocksClient.java b/android/src/main/java/HTTPClient/SocksClient.java similarity index 100% rename from common/src/main/java/HTTPClient/SocksClient.java rename to android/src/main/java/HTTPClient/SocksClient.java diff --git a/common/src/main/java/HTTPClient/SocksException.java b/android/src/main/java/HTTPClient/SocksException.java similarity index 100% rename from common/src/main/java/HTTPClient/SocksException.java rename to android/src/main/java/HTTPClient/SocksException.java diff --git a/common/src/main/java/HTTPClient/StreamDemultiplexor.java b/android/src/main/java/HTTPClient/StreamDemultiplexor.java similarity index 100% rename from common/src/main/java/HTTPClient/StreamDemultiplexor.java rename to android/src/main/java/HTTPClient/StreamDemultiplexor.java diff --git a/common/src/main/java/HTTPClient/TLSConnection.java b/android/src/main/java/HTTPClient/TLSConnection.java similarity index 100% rename from common/src/main/java/HTTPClient/TLSConnection.java rename to android/src/main/java/HTTPClient/TLSConnection.java diff --git a/common/src/main/java/HTTPClient/TransferEncodingModule.java b/android/src/main/java/HTTPClient/TransferEncodingModule.java similarity index 100% rename from common/src/main/java/HTTPClient/TransferEncodingModule.java rename to android/src/main/java/HTTPClient/TransferEncodingModule.java diff --git a/common/src/main/java/HTTPClient/URI.java b/android/src/main/java/HTTPClient/URI.java similarity index 100% rename from common/src/main/java/HTTPClient/URI.java rename to android/src/main/java/HTTPClient/URI.java diff --git a/common/src/main/java/HTTPClient/UncompressInputStream.java b/android/src/main/java/HTTPClient/UncompressInputStream.java similarity index 100% rename from common/src/main/java/HTTPClient/UncompressInputStream.java rename to android/src/main/java/HTTPClient/UncompressInputStream.java diff --git a/common/src/main/java/HTTPClient/Util.java b/android/src/main/java/HTTPClient/Util.java similarity index 100% rename from common/src/main/java/HTTPClient/Util.java rename to android/src/main/java/HTTPClient/Util.java diff --git a/common/src/main/java/HTTPClient/http/Handler.java b/android/src/main/java/HTTPClient/http/Handler.java similarity index 100% rename from common/src/main/java/HTTPClient/http/Handler.java rename to android/src/main/java/HTTPClient/http/Handler.java diff --git a/common/src/main/java/HTTPClient/https/Handler.java b/android/src/main/java/HTTPClient/https/Handler.java similarity index 100% rename from common/src/main/java/HTTPClient/https/Handler.java rename to android/src/main/java/HTTPClient/https/Handler.java diff --git a/common/src/main/java/HTTPClient/shttp/Handler.java b/android/src/main/java/HTTPClient/shttp/Handler.java similarity index 100% rename from common/src/main/java/HTTPClient/shttp/Handler.java rename to android/src/main/java/HTTPClient/shttp/Handler.java diff --git a/common/src/main/java/com/genexus/internet/HttpClientManual.java b/android/src/main/java/com/genexus/internet/HttpClientManual.java similarity index 100% rename from common/src/main/java/com/genexus/internet/HttpClientManual.java rename to android/src/main/java/com/genexus/internet/HttpClientManual.java diff --git a/androidreports/pom.xml b/androidreports/pom.xml index ca59ca52b..dd560bbba 100644 --- a/androidreports/pom.xml +++ b/androidreports/pom.xml @@ -18,6 +18,12 @@ ${project.groupId} gxcommon ${project.version} + + + org.apache.httpcomponents + httpclient + + ${project.groupId} diff --git a/common/pom.xml b/common/pom.xml index 81251aa3d..155255a84 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -44,7 +44,13 @@ bcpkix-jdk15on 1.69 - + + org.apache.httpcomponents + httpclient + 4.5.13 + compile + + gxcommon diff --git a/common/src/main/java/com/genexus/common/interfaces/IExtensionHTTPConnection.java b/common/src/main/java/com/genexus/common/interfaces/IExtensionHTTPConnection.java deleted file mode 100644 index d34c40afb..000000000 --- a/common/src/main/java/com/genexus/common/interfaces/IExtensionHTTPConnection.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.genexus.common.interfaces; - -import HTTPClient.HTTPConnection; -import HTTPClient.ProtocolNotSuppException; - -public interface IExtensionHTTPConnection { - - void createHttpConnectionFromApplet(Object applet, HTTPConnection httpConnection) throws ProtocolNotSuppException; - -} diff --git a/common/src/main/java/com/genexus/common/interfaces/SpecificImplementation.java b/common/src/main/java/com/genexus/common/interfaces/SpecificImplementation.java index 7a04fd425..40ed2ab30 100644 --- a/common/src/main/java/com/genexus/common/interfaces/SpecificImplementation.java +++ b/common/src/main/java/com/genexus/common/interfaces/SpecificImplementation.java @@ -24,7 +24,6 @@ public class SpecificImplementation { public static IExtensionMessages Messages; public static IExtensionPictureFormatter PictureFormatter; public static IExtensionSdtMessages_Message SdtMessages_Message; - public static IExtensionHTTPConnection HTTPConnection; public static ICryptoAlhorithms Algorithms; public static IExtensionModelContext ModelContext; public static boolean KeepDecimals; diff --git a/common/src/main/java/com/genexus/internet/GXHttpClient.java b/common/src/main/java/com/genexus/internet/GXHttpClient.java index 5e3d79ac9..7fd5c1e0e 100644 --- a/common/src/main/java/com/genexus/internet/GXHttpClient.java +++ b/common/src/main/java/com/genexus/internet/GXHttpClient.java @@ -1,10 +1,9 @@ package com.genexus.internet; -import HTTPClient.ParseException; -import HTTPClient.URI; import com.genexus.CommonUtil; import com.genexus.common.interfaces.SpecificImplementation; import java.io.*; +import java.net.URISyntaxException; import java.util.Hashtable; import java.util.Vector; @@ -130,17 +129,17 @@ public boolean getIncludeCookies() return this.includeCookies; } - public void setURL(String stringURL) - { + @Override + public void setURL(String stringURL) { try { - URI url = new URI(stringURL); + java.net.URI url = new java.net.URI(stringURL); setHost(url.getHost()); setPort(url.getPort()); setBaseURL(url.getPath()); setSecure(url.getScheme().equalsIgnoreCase("https") ? 1 : 0); } - catch (ParseException e) + catch (URISyntaxException e) { System.err.println("E " + e + " " + stringURL); e.printStackTrace(); diff --git a/common/src/main/java/com/genexus/internet/SSLConnConstructor.java b/common/src/main/java/com/genexus/internet/SSLConnConstructor.java new file mode 100644 index 000000000..e3a74191b --- /dev/null +++ b/common/src/main/java/com/genexus/internet/SSLConnConstructor.java @@ -0,0 +1,35 @@ +package com.genexus.internet; + +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.conn.ssl.TrustSelfSignedStrategy; +import org.apache.http.ssl.SSLContextBuilder; +import org.apache.http.ssl.SSLContexts; + +import javax.net.ssl.SSLContext; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; + +public class SSLConnConstructor { + + public static SSLConnectionSocketFactory getSSLSecureInstance(String[] supportedProtocols) { + try { + SSLContext sslContext = SSLContextBuilder + .create() + .loadTrustMaterial(new TrustSelfSignedStrategy()) + .build(); + return new SSLConnectionSocketFactory( + sslContext, + supportedProtocols, + null, + SSLConnectionSocketFactory.getDefaultHostnameVerifier()); + } catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) { + e.printStackTrace(); + } + return new SSLConnectionSocketFactory( + SSLContexts.createDefault(), + supportedProtocols, + null, + SSLConnectionSocketFactory.getDefaultHostnameVerifier()); + } +} diff --git a/gxmail/src/main/java/com/genexus/internet/POP3Session.java b/gxmail/src/main/java/com/genexus/internet/POP3Session.java index c16f65305..06876958c 100644 --- a/gxmail/src/main/java/com/genexus/internet/POP3Session.java +++ b/gxmail/src/main/java/com/genexus/internet/POP3Session.java @@ -19,6 +19,8 @@ import com.genexus.CommonUtil; import com.genexus.common.interfaces.SpecificImplementation; import com.genexus.platform.INativeFunctions; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.protocol.BasicHttpContext; public class POP3Session implements GXInternetConstants,IPOP3Session { @@ -136,23 +138,23 @@ private void connectNormal() throws GXMailException login(); } - private Socket getConnectionSocket(int type) throws UnknownHostException, IOException - { - System.setProperty("HTTPClient.sslUseTLS", "false"); - InetAddress ipAddr = InetAddress.getByName(pop3Host.trim()); - switch(type) - { - case CONN_NORMAL: - return new Socket(pop3Host.trim(), pop3Port); - case CONN_TLS: - System.setProperty("HTTPClient.sslUseTLS", "true"); - return HTTPClient.SSLManager.getSSLConnection(false).getSSLSocket(ipAddr, pop3Port); - case CONN_SSL: - HTTPClient.ISSLConnection connection = HTTPClient.SSLManager.getSSLConnection(false); - return connection.processSSLSocket(connection.getSSLSocket(ipAddr, pop3Port), ipAddr.getHostName(), pop3Port); - } - return new Socket(pop3Host.trim(), pop3Port); - } + private Socket getConnectionSocket(int type) throws UnknownHostException, IOException + { + InetAddress ipAddr = InetAddress.getByName(pop3Host.trim()); + SSLConnectionSocketFactory sslConn; + switch(type) + { + case CONN_NORMAL: + return new Socket(pop3Host.trim(), pop3Port); + case CONN_TLS: + sslConn = SSLConnConstructor.getSSLSecureInstance(new String[] { "TLSv1.1", "TLSv1.2" }); + return sslConn.createLayeredSocket(new Socket(pop3Host.trim(), pop3Port),ipAddr.getHostName(),pop3Port,new BasicHttpContext()); + case CONN_SSL: + sslConn = SSLConnConstructor.getSSLSecureInstance(new String[] { "TLSv1" }); + return sslConn.createLayeredSocket(new Socket(pop3Host.trim(), pop3Port),ipAddr.getHostName(),pop3Port,new BasicHttpContext()); + } + return new Socket(pop3Host.trim(), pop3Port); + } public void logout(GXPOP3Session sessionInfo) { diff --git a/gxmail/src/main/java/com/genexus/internet/SMTPSession.java b/gxmail/src/main/java/com/genexus/internet/SMTPSession.java index b5fd3c6a7..8e20d95ac 100644 --- a/gxmail/src/main/java/com/genexus/internet/SMTPSession.java +++ b/gxmail/src/main/java/com/genexus/internet/SMTPSession.java @@ -28,6 +28,8 @@ import com.genexus.CommonUtil; import com.genexus.common.interfaces.SpecificImplementation; import com.genexus.platform.INativeFunctions; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.protocol.BasicHttpContext; final class SMTPSession implements GXInternetConstants,ISMTPSession { @@ -452,23 +454,23 @@ public void run() } } - private Socket getConnectionSocket(int type) throws UnknownHostException, IOException - { - System.setProperty("HTTPClient.sslUseTLS", "false"); - InetAddress ipAddr = InetAddress.getByName(host.trim()); - switch(type) - { - case CONN_NORMAL: - return new Socket(host.trim(), port); - case CONN_TLS: - System.setProperty("HTTPClient.sslUseTLS", "true"); - return HTTPClient.SSLManager.getSSLConnection(false).getSSLSocket(ipAddr, port); - case CONN_SSL: - HTTPClient.ISSLConnection connection = HTTPClient.SSLManager.getSSLConnection(false); - return connection.processSSLSocket(connection.getSSLSocket(ipAddr, port), ipAddr.getHostName(), port); - } - return new Socket(host.trim(), port); - } + private Socket getConnectionSocket(int type) throws UnknownHostException, IOException + { + InetAddress ipAddr = InetAddress.getByName(host.trim()); + SSLConnectionSocketFactory sslConn; + switch(type) + { + case CONN_NORMAL: + return new Socket(host.trim(), port); + case CONN_TLS: + sslConn = SSLConnConstructor.getSSLSecureInstance(new String[] { "TLSv1.1", "TLSv1.2" }); + return sslConn.createLayeredSocket(new Socket(host.trim(), port),ipAddr.getHostName(),port,new BasicHttpContext()); + case CONN_SSL: + sslConn = SSLConnConstructor.getSSLSecureInstance(new String[] { "TLSv1" }); + return sslConn.createLayeredSocket(new Socket(host.trim(), port),ipAddr.getHostName(),port,new BasicHttpContext()); + } + return new Socket(host.trim(), port); + } private void doLogin(boolean startTLS) throws GXMailException { diff --git a/java/src/main/java/com/genexus/internet/HttpClientJavaLib.java b/java/src/main/java/com/genexus/internet/HttpClientJavaLib.java index 170c40875..5cc991312 100644 --- a/java/src/main/java/com/genexus/internet/HttpClientJavaLib.java +++ b/java/src/main/java/com/genexus/internet/HttpClientJavaLib.java @@ -5,9 +5,6 @@ import java.net.URISyntaxException; import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; import java.util.*; import com.genexus.servlet.http.ICookie; import com.genexus.util.IniFile; @@ -32,8 +29,6 @@ import org.apache.http.conn.ConnectionKeepAliveStrategy; import org.apache.http.conn.socket.ConnectionSocketFactory; import org.apache.http.conn.socket.PlainConnectionSocketFactory; -import org.apache.http.conn.ssl.SSLConnectionSocketFactory; -import org.apache.http.conn.ssl.TrustSelfSignedStrategy; import org.apache.http.cookie.Cookie; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.impl.auth.NTLMSchemeFactory; @@ -43,13 +38,9 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.message.BasicHeaderElementIterator; import org.apache.http.protocol.HTTP; -import org.apache.http.ssl.SSLContextBuilder; -import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.apache.logging.log4j.Logger; -import javax.net.ssl.SSLContext; - public class HttpClientJavaLib extends GXHttpClient { public HttpClientJavaLib() { @@ -64,7 +55,7 @@ private static void getPoolInstance() { if(connManager == null) { Registry socketFactoryRegistry = RegistryBuilder.create() - .register("http", PlainConnectionSocketFactory.INSTANCE).register("https", getSSLSecureInstance()) + .register("http", PlainConnectionSocketFactory.INSTANCE).register("https",SSLConnConstructor.getSSLSecureInstance(new String[] { "TLSv1", "TLSv1.1", "TLSv1.2" })) .build(); connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry); connManager.setMaxTotal((int) CommonUtil.val(clientCfg.getProperty("Client","HTTPCLIENT_MAX_SIZE","1000"))); @@ -163,23 +154,6 @@ private void resetStateAdapted() getheadersToSend().clear(); } - @Override - public void setURL(String stringURL) { - try - { - java.net.URI url = new java.net.URI(stringURL); - setHost(url.getHost()); - setPort(url.getPort()); - setBaseURL(url.getPath()); - setSecure(url.getScheme().equalsIgnoreCase("https") ? 1 : 0); - } - catch (URISyntaxException e) - { - System.err.println("E " + e + " " + stringURL); - e.printStackTrace(); - } - } - private String getURLValid(String url) { java.net.URI uri; try @@ -214,27 +188,6 @@ private String getURLValid(String url) { } } - private static SSLConnectionSocketFactory getSSLSecureInstance() { - try { - SSLContext sslContext = SSLContextBuilder - .create() - .loadTrustMaterial(new TrustSelfSignedStrategy()) - .build(); - return new SSLConnectionSocketFactory( - sslContext, - new String[] { "TLSv1", "TLSv1.1", "TLSv1.2" }, - null, - SSLConnectionSocketFactory.getDefaultHostnameVerifier()); - } catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) { - e.printStackTrace(); - } - return new SSLConnectionSocketFactory( - SSLContexts.createDefault(), - new String[] { "TLSv1", "TLSv1.1", "TLSv1.2"}, - null, - SSLConnectionSocketFactory.getDefaultHostnameVerifier()); - } - private CookieStore setAllStoredCookies() { ICookie[] webcookies; diff --git a/java/src/main/java/com/genexus/specific/java/Connect.java b/java/src/main/java/com/genexus/specific/java/Connect.java index 514024fce..89c5ca116 100644 --- a/java/src/main/java/com/genexus/specific/java/Connect.java +++ b/java/src/main/java/com/genexus/specific/java/Connect.java @@ -32,7 +32,6 @@ public static void init() if (!ApplicationContext.getInstance().getReorganization()) SpecificImplementation.GXXMLSerializer = new GXXMLserializer(); SpecificImplementation.HttpClient = new HttpClient(); - SpecificImplementation.HTTPConnection = new HTTPConnection(); SpecificImplementation.HttpCookie = new HttpCookie(); SpecificImplementation.ImagesPath = new ImagesPath(); SpecificImplementation.LocalUtil = new LocalUtil(); diff --git a/java/src/main/java/com/genexus/specific/java/HTTPConnection.java b/java/src/main/java/com/genexus/specific/java/HTTPConnection.java deleted file mode 100644 index 22e7cee47..000000000 --- a/java/src/main/java/com/genexus/specific/java/HTTPConnection.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.genexus.specific.java; - -import java.applet.Applet; - -import com.genexus.common.interfaces.IExtensionHTTPConnection; - -import HTTPClient.ProtocolNotSuppException; - -@SuppressWarnings("deprecation") -public class HTTPConnection implements IExtensionHTTPConnection { - - - - @Override - public void createHttpConnectionFromApplet(Object obj, HTTPClient.HTTPConnection httpConnection) throws ProtocolNotSuppException { - Applet applet = (Applet) obj; - httpConnection.setInfo(applet.getCodeBase().getProtocol(), - applet.getCodeBase().getHost(), - applet.getCodeBase().getPort(), null, -1); - - } - -} diff --git a/java/src/main/java/com/genexus/specific/java/HttpClient.java b/java/src/main/java/com/genexus/specific/java/HttpClient.java index 87b96e4c4..328e9a12f 100644 --- a/java/src/main/java/com/genexus/specific/java/HttpClient.java +++ b/java/src/main/java/com/genexus/specific/java/HttpClient.java @@ -4,9 +4,7 @@ import com.genexus.CommonUtil; import com.genexus.common.interfaces.IExtensionHttpClient; -import com.genexus.common.interfaces.SpecificImplementation; import com.genexus.internet.HttpClientJavaLib; -import com.genexus.internet.HttpClientManual; import javax.net.ssl.SSLSocket; @@ -39,27 +37,15 @@ public void prepareSSLSocket(SSLSocket sock) { } - private com.genexus.internet.IHttpClient useHttpClientOldImplementation() { - com.genexus.internet.IHttpClient client = new HttpClientManual(); - SpecificImplementation.HttpClient.initializeHttpClient(client); - return client; - } - @Override public com.genexus.internet.IHttpClient initHttpClientImpl() { com.genexus.internet.IHttpClient client = null; try { - - if (com.genexus.ResourceReader.getResourceAsStream("useoldhttpclient.txt") == null) { - Class.forName("org.apache.http.impl.conn.PoolingHttpClientConnectionManager"); // httpclient-4.5.14.jar dectected by reflection - client = new HttpClientJavaLib(); - } else - client = useHttpClientOldImplementation(); + Class.forName("org.apache.http.impl.conn.PoolingHttpClientConnectionManager"); // httpclient-4.5.14.jar dectected by reflection + client = new HttpClientJavaLib(); } catch (ClassNotFoundException e) { - - client = useHttpClientOldImplementation(); - + org.apache.logging.log4j.LogManager.getLogger(HttpClient.class).error("HttpClient jars not detected. Check if httpclient-4.5.*.jar and httpcore-4.4.*.jar are added in the classpath",e); } finally { return client; diff --git a/java/src/main/java/com/genexus/webpanels/GXWebObjectBase.java b/java/src/main/java/com/genexus/webpanels/GXWebObjectBase.java index 0b4d57895..758c85aa9 100644 --- a/java/src/main/java/com/genexus/webpanels/GXWebObjectBase.java +++ b/java/src/main/java/com/genexus/webpanels/GXWebObjectBase.java @@ -256,7 +256,6 @@ private void cleanModelContext() { ((ThreadLocal)com.genexus.CommonUtil.threadCalendar).getClass().getMethod("remove", new Class[0]).invoke(com.genexus.CommonUtil.threadCalendar, (java.lang.Object[])new Class[0]); ((ThreadLocal)com.genexus.ModelContext.threadModelContext).getClass().getMethod("remove", new Class[0]).invoke(com.genexus.ModelContext.threadModelContext, (java.lang.Object[])new Class[0]); - HTTPClient.StreamDemultiplexor.cleanup(); } catch (NoSuchMethodException e) {