Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
libokhttp-java
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian Java Maintainers
libokhttp-java
Commits
1a2a4fcf
Commit
1a2a4fcf
authored
6 years ago
by
Markus Koschany
Browse files
Options
Downloads
Patches
Plain Diff
Drop no-Conscrypt.patch
parent
a4b1ac31
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/no-Conscrypt.patch
+0
-147
0 additions, 147 deletions
debian/patches/no-Conscrypt.patch
debian/patches/series
+0
-1
0 additions, 1 deletion
debian/patches/series
with
0 additions
and
148 deletions
debian/patches/no-Conscrypt.patch
deleted
100644 → 0
+
0
−
147
View file @
a4b1ac31
From: Markus Koschany <apo@debian.org>
Date: Fri, 27 Jul 2018 19:22:11 +0200
Subject: no Conscrypt
---
.../internal/platform/ConscryptPlatform.java | 118 ---------------------
.../java/okhttp3/internal/platform/Platform.java | 2 +-
2 files changed, 1 insertion(+), 119 deletions(-)
delete mode 100644 okhttp/src/main/java/okhttp3/internal/platform/ConscryptPlatform.java
diff --git a/okhttp/src/main/java/okhttp3/internal/platform/ConscryptPlatform.java b/okhttp/src/main/java/okhttp3/internal/platform/ConscryptPlatform.java
deleted file mode 100644
index 9ed9b1d..0000000
--- a/okhttp/src/main/java/okhttp3/internal/platform/ConscryptPlatform.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2014 Square, Inc.
- *
- * Licensed 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 okhttp3.internal.platform;
-
-import java.security.NoSuchAlgorithmException;
-import java.security.Provider;
-import java.util.List;
-import javax.annotation.Nullable;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocket;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.X509TrustManager;
-import okhttp3.Protocol;
-import org.conscrypt.Conscrypt;
-import org.conscrypt.OpenSSLProvider;
-
-/**
- * Platform using Conscrypt (conscrypt.org) if installed as the first Security Provider.
- *
- * Requires org.conscrypt:conscrypt-openjdk-uber on the classpath.
- */
-public class ConscryptPlatform extends Platform {
- private ConscryptPlatform() {
- }
-
- private Provider getProvider() {
- return new OpenSSLProvider();
- }
-
- @Override public X509TrustManager trustManager(SSLSocketFactory sslSocketFactory) {
- if (!Conscrypt.isConscrypt(sslSocketFactory)) {
- return super.trustManager(sslSocketFactory);
- }
-
- try {
- // org.conscrypt.SSLParametersImpl
- Object sp =
- readFieldOrNull(sslSocketFactory, Object.class, "sslParameters");
-
- if (sp != null) {
- return readFieldOrNull(sp, X509TrustManager.class, "x509TrustManager");
- }
-
- return null;
- } catch (Exception e) {
- throw new UnsupportedOperationException(
- "clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on Conscrypt", e);
- }
- }
-
- @Override public void configureTlsExtensions(
- SSLSocket sslSocket, String hostname, List<Protocol> protocols) {
- if (Conscrypt.isConscrypt(sslSocket)) {
- // Enable SNI and session tickets.
- if (hostname != null) {
- Conscrypt.setUseSessionTickets(sslSocket, true);
- Conscrypt.setHostname(sslSocket, hostname);
- }
-
- // Enable ALPN.
- List<String> names = Platform.alpnProtocolNames(protocols);
- Conscrypt.setApplicationProtocols(sslSocket, names.toArray(new String[0]));
- } else {
- super.configureTlsExtensions(sslSocket, hostname, protocols);
- }
- }
-
- @Override public @Nullable String getSelectedProtocol(SSLSocket sslSocket) {
- if (Conscrypt.isConscrypt(sslSocket)) {
- return Conscrypt.getApplicationProtocol(sslSocket);
- } else {
- return super.getSelectedProtocol(sslSocket);
- }
- }
-
- @Override public SSLContext getSSLContext() {
- try {
- return SSLContext.getInstance("TLS", getProvider());
- } catch (NoSuchAlgorithmException e) {
- throw new IllegalStateException("No TLS provider", e);
- }
- }
-
- public static Platform buildIfSupported() {
- try {
- // trigger early exception over a fatal error
- Class.forName("org.conscrypt.ConscryptEngineSocket");
-
- if (!Conscrypt.isAvailable()) {
- return null;
- }
-
- return new ConscryptPlatform();
- } catch (ClassNotFoundException e) {
- return null;
- }
- }
-
- @Override
- public void configureSslSocketFactory(SSLSocketFactory socketFactory) {
- if (Conscrypt.isConscrypt(socketFactory)) {
- Conscrypt.setUseEngineSocket(socketFactory, true);
- }
- }
-}
diff --git a/okhttp/src/main/java/okhttp3/internal/platform/Platform.java b/okhttp/src/main/java/okhttp3/internal/platform/Platform.java
index 4803359..8a63b47 100644
--- a/okhttp/src/main/java/okhttp3/internal/platform/Platform.java
+++ b/okhttp/src/main/java/okhttp3/internal/platform/Platform.java
@@ -205,7 +205,7 @@
public class Platform {
}
if (isConscryptPreferred()) {
- Platform conscrypt = ConscryptPlatform.buildIfSupported();
+ Platform conscrypt = null;
if (conscrypt != null) {
return conscrypt;
This diff is collapsed.
Click to expand it.
debian/patches/series
+
0
−
1
View file @
1a2a4fcf
no-javac-with-errorprone.patch
no-Conscrypt.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment