From 476eab306eaae6dc0dbba82a274d7daaada9ec00 Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Mon, 23 Nov 2015 09:47:38 +1000 Subject: [PATCH] - Upgrade to upstream version 3.8.1 - Now require Java 1.8 --- .gitignore | 1 + sni.patch | 88 ---------------------------------------------- sources | 2 +- zanata-client.spec | 21 +++++------ 4 files changed, 13 insertions(+), 99 deletions(-) delete mode 100644 sni.patch diff --git a/.gitignore b/.gitignore index 34f5320..a4ea146 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /client-3.6.0.zip /client-3.7.3.zip /client-3.7.4.zip +/client-3.8.1.zip diff --git a/sni.patch b/sni.patch deleted file mode 100644 index 7772d0b..0000000 --- a/sni.patch +++ /dev/null @@ -1,88 +0,0 @@ -diff --git pom.xml pom.xml -index e605ef1..773e5ca 100644 ---- pom.xml -+++ pom.xml -@@ -175,7 +175,7 @@ - - org.apache.httpcomponents - httpclient -- 4.3.3 -+ 4.2.5 - - - commons-logging -diff --git zanata-rest-client/src/main/java/org/zanata/rest/client/ZanataProxyFactory.java zanata-rest-client/src/main/java/org/zanata/rest/client/ZanataProxyFactory.java -index 9a59c61..7d1fb4b 100644 ---- zanata-rest-client/src/main/java/org/zanata/rest/client/ZanataProxyFactory.java -+++ zanata-rest-client/src/main/java/org/zanata/rest/client/ZanataProxyFactory.java -@@ -9,6 +9,7 @@ import java.net.Socket; - import java.net.URI; - import java.net.URISyntaxException; - import java.net.URL; -+import java.net.UnknownHostException; - import java.security.SecureRandom; - import java.security.cert.CertificateException; - import java.security.cert.X509Certificate; -@@ -29,6 +30,7 @@ import org.apache.http.conn.scheme.Scheme; - import org.apache.http.conn.ssl.SSLSocketFactory; - import org.apache.http.conn.ssl.X509HostnameVerifier; - import org.apache.http.impl.client.DefaultHttpClient; -+import org.apache.http.params.HttpParams; - import org.apache.http.protocol.HttpContext; - import org.apache.maven.artifact.versioning.DefaultArtifactVersion; - import org.jboss.resteasy.client.ClientExecutor; -@@ -137,28 +139,34 @@ public class ZanataProxyFactory implements ITranslationResourcesFactory { - - sslContext.init(null, trustAllCerts, new SecureRandom()); - -- SSLSocketFactory factory = new SSLSocketFactory(sslContext) { -- @Override -- public Socket connectSocket( -- int connectTimeout, -- Socket socket, -- HttpHost host, -- InetSocketAddress remoteAddress, -- InetSocketAddress localAddress, -- HttpContext context) throws IOException, -- ConnectTimeoutException { -- if (socket instanceof SSLSocket) { -- try { -- PropertyUtils.setProperty(socket, "host", -- host.getHostName()); -- } catch (Exception ex) { -- log.warn("Unable to enable SNI; you may have trouble connecting to some secure hosts. Please ensure that you are running Java 1.7 or later."); -+ SSLSocketFactory factory; -+ if (sslCertDisabled) { -+ // avoid triggering the problem described here: -+ // https://stackoverflow.com/questions/7615645/ssl-handshake-alert-unrecognized-name-error-since-upgrade-to-java-1-7-0 -+ factory = new SSLSocketFactory(sslContext); -+ } else { -+ factory = new SSLSocketFactory(sslContext) { -+ // NB: This is only for httpcomponents-client 4.2, not 4.3 -+ @Override -+ public Socket connectSocket(Socket socket, -+ InetSocketAddress remoteAddress, -+ InetSocketAddress localAddress, -+ HttpParams params) -+ throws IOException, UnknownHostException, -+ ConnectTimeoutException { -+ if (socket instanceof SSLSocket) { -+ try { -+ PropertyUtils.setProperty(socket, "host", -+ remoteAddress.getHostName()); -+ } catch (Exception ex) { -+ log.warn("Unable to enable SNI; you may have trouble connecting to some secure hosts. Please ensure that you are running Java 1.7 or later."); -+ } - } -+ return super.connectSocket(socket, remoteAddress, -+ localAddress, params); - } -- return super.connectSocket(connectTimeout, socket, host, remoteAddress, -- localAddress, context); -- } -- }; -+ }; -+ } - - HttpClient client = new DefaultHttpClient(); - diff --git a/sources b/sources index edd760f..e204638 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2da5014dbdc4fbeab137fcb39ed7f60c client-3.7.4.zip +82abe84704d6168d49431ec96316c819 client-3.8.1.zip diff --git a/zanata-client.spec b/zanata-client.spec index f9f89b9..8b5d7cf 100644 --- a/zanata-client.spec +++ b/zanata-client.spec @@ -3,12 +3,12 @@ %global submodule_rest zanata-rest-%{shortname} %global submodule_commands zanata-%{shortname}-commands %global submodule_cli zanata-cli -%global java_version 1.7 +%global java_ver_min 1.7 %global jersey_min_version 1.17 -%global zanata_parent_version 24 -%global zanata_api_version 3.7.3 -%global zanata_common_version 3.7.2 +%global zanata_parent_version 25 +%global zanata_api_version 3.8.3 +%global zanata_common_version 3.8.1 %if 0%{?fedora} >= 23 %global jersey_pkg_name jersey1 %else @@ -17,7 +17,7 @@ %global jersey_version %(rpm -q --qf "%%{version}" %{jersey_pkg_name}) Name: zanata-%{shortname} -Version: 3.7.4 +Version: 3.8.1 Release: 1%{?dist} Summary: Zanata client module @@ -29,7 +29,7 @@ Source0: https://github.com/zanata/%{name}/archive/%{shortname}-%{version BuildArch: noarch BuildRequires: maven-local -BuildRequires: java-devel >= 1:%{java_version} +BuildRequires: java-devel >= 1:%{java_ver_min} BuildRequires: args4j >= 2.0.25 BuildRequires: exec-maven-plugin BuildRequires: %{jersey_pkg_name} >= %{jersey_min_version} @@ -56,7 +56,7 @@ BuildRequires: zanata-parent >= %{zanata_parent_version} BuildRequires: zanata-api >= %{zanata_api_version} BuildRequires: zanata-common >= %{zanata_common_version} -Requires: java-headless >= 1:%{java_version} +Requires: java-headless >= 1:%{java_ver_min} Requires: args4j >= 2.0.25 Requires: %{jersey_pkg_name} >= %{jersey_min_version} Requires: %{jersey_pkg_name}-contribs >= %{jersey_min_version} @@ -100,7 +100,7 @@ This includes sub modules: %pom_xpath_set "pom:properties/pom:jersey.version" %{jersey_version} # Ensure it compile with supported java version -%pom_xpath_inject "pom:plugins" "org.apache.maven.pluginsmaven-compiler-plugin%{java_version}%{java_version}truetrue" +%pom_xpath_inject "pom:plugins" "org.apache.maven.pluginsmaven-compiler-plugin%{java_ver_min}%{java_ver_min}truetrue" # simpleframework in fedora is too old rm %{submodule_cli}/src/test/java/org/zanata/client/HTTPMockContainer.java @@ -186,8 +186,9 @@ chmod 755 %{buildroot}%{_bindir}/zanata-cli %files javadoc -f .mfiles-javadoc %changelog -* Mon Aug 10 2015 Ding-Yi Chen 3.7.4-1 -- Upgrade to upstream version 3.7.4 +* Sun Nov 22 2015 Ding-Yi Chen 3.8.1-1 +- Upgrade to upstream version 3.8.1 +- Now require Java 1.8 * Tue Jul 14 2015 Ding-Yi Chen 3.7.3-1 - Upgrade to upstream version 3.7.3