mirror of
https://github.com/square/okhttp.git
synced 2025-07-31 05:04:26 +03:00
Upgrade Okio and some build dependencies
The new ktlint sorts imports which makes this diff large. The new japicmp ignores 'final' modifier changes in final classes. We adopt the Google style for checkstyle.xml. Okio readByteString() now uses segments more aggressively, so we need to mitigate that to avoid tracking those segments in a test.
This commit is contained in:
61
build.gradle
61
build.gradle
@ -2,24 +2,24 @@ import net.ltgt.gradle.errorprone.CheckSeverity
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.versions = [
|
ext.versions = [
|
||||||
'animalSniffer': '1.17',
|
'animalSniffer': '1.18',
|
||||||
'assertj': '3.11.0',
|
'assertj': '3.14.0',
|
||||||
'bouncycastle': '1.64',
|
'bouncycastle': '1.64',
|
||||||
'brotli': '0.1.2',
|
'brotli': '0.1.2',
|
||||||
'checkstyle': '8.15',
|
'checkstyle': '8.28',
|
||||||
'conscrypt': '2.2.1',
|
'conscrypt': '2.2.1',
|
||||||
'corretto': '1.1.1',
|
'corretto': '1.2.0',
|
||||||
'findbugs': '3.0.2',
|
'findbugs': '3.0.2',
|
||||||
'guava': '27.0.1-jre',
|
'guava': '28.2-jre',
|
||||||
'java': '1.8',
|
'java': '1.8',
|
||||||
'jnrUnixsocket': '0.22',
|
'jnrUnixsocket': '0.25',
|
||||||
'jsoup': '1.11.3',
|
'jsoup': '1.12.1',
|
||||||
'junit': '4.12',
|
'junit': '4.13',
|
||||||
'kotlin': '1.3.61',
|
'kotlin': '1.3.61',
|
||||||
'moshi': '1.9.2',
|
'moshi': '1.9.2',
|
||||||
'okio': '2.4.1',
|
'okio': '2.4.3',
|
||||||
'ktlint': '0.31.0',
|
'ktlint': '0.36.0',
|
||||||
'picocli': '4.0.1',
|
'picocli': '4.1.4',
|
||||||
'openjsse': '1.1.0'
|
'openjsse': '1.1.0'
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -50,8 +50,8 @@ buildscript {
|
|||||||
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.8.0'
|
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.8.0'
|
||||||
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:1.1.1'
|
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:1.1.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
|
||||||
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.18"
|
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.10.0"
|
||||||
classpath 'com.diffplug.spotless:spotless-plugin-gradle:3.26.1'
|
classpath 'com.diffplug.spotless:spotless-plugin-gradle:3.27.0'
|
||||||
classpath 'com.android.tools.build:gradle:3.4.2'
|
classpath 'com.android.tools.build:gradle:3.4.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,8 +64,8 @@ buildscript {
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'ru.vyarus.animalsniffer' version '1.5.0'
|
id 'ru.vyarus.animalsniffer' version '1.5.0'
|
||||||
id 'com.github.johnrengelman.shadow' version '4.0.1'
|
id 'com.github.johnrengelman.shadow' version '5.2.0'
|
||||||
id 'me.champeau.gradle.japicmp' version '0.2.6'
|
id 'me.champeau.gradle.japicmp' version '0.2.9'
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
@ -176,7 +176,7 @@ subprojects { project ->
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
errorproneJavac 'com.google.errorprone:javac:9+181-r4173-1'
|
errorproneJavac 'com.google.errorprone:javac:9+181-r4173-1'
|
||||||
errorprone 'com.google.errorprone:error_prone_core:2.3.3'
|
errorprone 'com.google.errorprone:error_prone_core:2.3.4'
|
||||||
}
|
}
|
||||||
tasks.withType(JavaCompile).configureEach {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
@ -193,19 +193,21 @@ subprojects { project ->
|
|||||||
// plugin overwrites our dokka configuration on projects where it's applied.
|
// plugin overwrites our dokka configuration on projects where it's applied.
|
||||||
afterEvaluate { p ->
|
afterEvaluate { p ->
|
||||||
p.tasks.dokka {
|
p.tasks.dokka {
|
||||||
reportUndocumented = false
|
configuration {
|
||||||
skipDeprecated = true
|
reportUndocumented = false
|
||||||
jdkVersion = 8
|
skipDeprecated = true
|
||||||
packageOptions {
|
jdkVersion = 8
|
||||||
prefix = "okhttp3.internal"
|
perPackageOption {
|
||||||
suppress = true
|
prefix = "okhttp3.internal"
|
||||||
}
|
suppress = true
|
||||||
if (project.file('Module.md').exists()) {
|
}
|
||||||
includes = ['Module.md']
|
if (project.file('Module.md').exists()) {
|
||||||
}
|
includes = ['Module.md']
|
||||||
externalDocumentationLink {
|
}
|
||||||
url = new URL("https://square.github.io/okio/2.x/okio/")
|
externalDocumentationLink {
|
||||||
packageListUrl = new URL("https://square.github.io/okio/2.x/okio/package-list")
|
url = new URL("https://square.github.io/okio/2.x/okio/")
|
||||||
|
packageListUrl = new URL("https://square.github.io/okio/2.x/okio/package-list")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,6 +236,7 @@ def alpnBootVersion() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def alpnBootVersionForPatchVersion(String javaVersion, int patchVersion) {
|
def alpnBootVersionForPatchVersion(String javaVersion, int patchVersion) {
|
||||||
|
// https://www.eclipse.org/jetty/documentation/current/alpn-chapter.html#alpn-versions
|
||||||
switch (patchVersion) {
|
switch (patchVersion) {
|
||||||
case 0..24:
|
case 0..24:
|
||||||
return '8.1.0.v20141016'
|
return '8.1.0.v20141016'
|
||||||
|
430
checkstyle.xml
430
checkstyle.xml
@ -1,145 +1,321 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<!DOCTYPE module PUBLIC
|
<!DOCTYPE module PUBLIC
|
||||||
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||||
|
|
||||||
<module name="Checker">
|
<!--
|
||||||
<module name="SuppressWarningsFilter"/>
|
Checkstyle configuration that checks the Google coding conventions from Google Java Style
|
||||||
<module name="NewlineAtEndOfFile"/>
|
that can be found at https://google.github.io/styleguide/javaguide.html
|
||||||
<module name="FileLength"/>
|
|
||||||
<module name="FileTabCharacter"/>
|
|
||||||
|
|
||||||
<!-- Trailing spaces -->
|
Checkstyle is very configurable. Be sure to read the documentation at
|
||||||
<module name="RegexpSingleline">
|
http://checkstyle.org (or in your downloaded distribution).
|
||||||
<property name="format" value="\s+$"/>
|
|
||||||
<property name="message" value="Line has trailing spaces."/>
|
To completely disable a check, just comment it out or delete it from the file.
|
||||||
|
To suppress certain violations please review suppression filters.
|
||||||
|
|
||||||
|
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<module name = "Checker">
|
||||||
|
<property name="charset" value="UTF-8"/>
|
||||||
|
|
||||||
|
<property name="severity" value="warning"/>
|
||||||
|
|
||||||
|
<property name="fileExtensions" value="java, properties, xml"/>
|
||||||
|
<!-- Excludes all 'module-info.java' files -->
|
||||||
|
<!-- See https://checkstyle.org/config_filefilters.html -->
|
||||||
|
<module name="BeforeExecutionExclusionFileFilter">
|
||||||
|
<property name="fileNamePattern" value="module\-info\.java$"/>
|
||||||
|
</module>
|
||||||
|
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
|
||||||
|
<module name="SuppressionFilter">
|
||||||
|
<property name="file" value="${org.checkstyle.google.suppressionfilter.config}"
|
||||||
|
default="checkstyle-suppressions.xml" />
|
||||||
|
<property name="optional" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
<!-- Space after 'for' and 'if' -->
|
<!-- Checks for whitespace -->
|
||||||
<module name="RegexpSingleline">
|
<!-- See http://checkstyle.org/config_whitespace.html -->
|
||||||
<property name="format" value="^\s*(for|if)\b[^ ]"/>
|
<module name="FileTabCharacter">
|
||||||
<property name="message" value="Space needed before opening parenthesis."/>
|
<property name="eachLine" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
<!-- For each spacing -->
|
<module name="LineLength">
|
||||||
<module name="RegexpSingleline">
|
<property name="fileExtensions" value="java"/>
|
||||||
<property name="format" value="^\s*for \(.*?([^ ]:|:[^ ])"/>
|
<property name="max" value="100"/>
|
||||||
<property name="message" value="Space needed around ':' character."/>
|
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
<module name="TreeWalker">
|
<module name="TreeWalker">
|
||||||
<!-- Checks for Javadoc comments. -->
|
<module name="OuterTypeFilename"/>
|
||||||
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
|
<module name="IllegalTokenText">
|
||||||
<!--module name="JavadocMethod"/-->
|
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
|
||||||
<!--module name="JavadocType"/-->
|
<property name="format"
|
||||||
<!--module name="JavadocVariable"/-->
|
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
|
||||||
<module name="JavadocStyle"/>
|
<property name="message"
|
||||||
|
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
|
||||||
|
</module>
|
||||||
<!-- Checks for Naming Conventions. -->
|
<module name="AvoidEscapedUnicodeCharacters">
|
||||||
<!-- See http://checkstyle.sf.net/config_naming.html -->
|
<property name="allowEscapesForControlCharacters" value="true"/>
|
||||||
<!--<module name="ConstantName"/>-->
|
<property name="allowByTailComment" value="true"/>
|
||||||
<module name="LocalFinalVariableName"/>
|
<property name="allowNonPrintableEscapes" value="true"/>
|
||||||
<module name="LocalVariableName"/>
|
</module>
|
||||||
<module name="MemberName"/>
|
|
||||||
<module name="MethodName"/>
|
|
||||||
<!--<module name="PackageName"/>-->
|
|
||||||
<module name="ParameterName"/>
|
|
||||||
<module name="StaticVariableName"/>
|
|
||||||
<module name="TypeName"/>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Checks for imports -->
|
|
||||||
<!-- See http://checkstyle.sf.net/config_import.html -->
|
|
||||||
<module name="AvoidStarImport"/>
|
<module name="AvoidStarImport"/>
|
||||||
<module name="IllegalImport"/>
|
<module name="OneTopLevelClass"/>
|
||||||
<!-- defaults to sun.* packages -->
|
<module name="NoLineWrap">
|
||||||
<module name="RedundantImport"/>
|
<property name="tokens" value="PACKAGE_DEF, IMPORT, STATIC_IMPORT"/>
|
||||||
<module name="UnusedImports">
|
|
||||||
<property name="processJavadoc" value="true"/>
|
|
||||||
</module>
|
</module>
|
||||||
|
<module name="EmptyBlock">
|
||||||
|
<property name="option" value="TEXT"/>
|
||||||
<!-- Checks for Size Violations. -->
|
|
||||||
<!-- See http://checkstyle.sf.net/config_sizes.html -->
|
|
||||||
<module name="LineLength">
|
|
||||||
<property name="max" value="100"/>
|
|
||||||
</module>
|
|
||||||
<module name="MethodLength">
|
|
||||||
<property name="max" value="200"/>
|
|
||||||
</module>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Checks for whitespace -->
|
|
||||||
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
|
||||||
<module name="GenericWhitespace"/>
|
|
||||||
<!--<module name="EmptyForIteratorPad"/>-->
|
|
||||||
<module name="MethodParamPad"/>
|
|
||||||
<!--<module name="NoWhitespaceAfter"/>-->
|
|
||||||
<!--<module name="NoWhitespaceBefore"/>-->
|
|
||||||
<module name="OperatorWrap"/>
|
|
||||||
<module name="ParenPad"/>
|
|
||||||
<module name="TypecastParenPad"/>
|
|
||||||
<module name="WhitespaceAfter"/>
|
|
||||||
<module name="WhitespaceAround">
|
|
||||||
<property name="tokens"
|
<property name="tokens"
|
||||||
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN,
|
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
|
||||||
COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_CATCH,
|
|
||||||
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN,
|
|
||||||
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS,
|
|
||||||
MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SLIST,
|
|
||||||
SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
|
|
||||||
</module>
|
</module>
|
||||||
|
<module name="NeedBraces">
|
||||||
|
<property name="tokens"
|
||||||
<!-- Modifier Checks -->
|
value="LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_IF, LITERAL_WHILE"/>
|
||||||
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
|
</module>
|
||||||
<module name="ModifierOrder"/>
|
<module name="LeftCurly">
|
||||||
<module name="RedundantModifier"/>
|
<property name="tokens"
|
||||||
|
value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
|
||||||
|
INTERFACE_DEF, LAMBDA, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT,
|
||||||
<!-- Checks for blocks. You know, those {}'s -->
|
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF,
|
||||||
<!-- See http://checkstyle.sf.net/config_blocks.html -->
|
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF,
|
||||||
<module name="AvoidNestedBlocks"/>
|
OBJBLOCK, STATIC_INIT"/>
|
||||||
<!--module name="EmptyBlock"/-->
|
</module>
|
||||||
<module name="LeftCurly"/>
|
<module name="RightCurly">
|
||||||
<!--<module name="NeedBraces"/>-->
|
<property name="id" value="RightCurlySame"/>
|
||||||
<module name="RightCurly"/>
|
<property name="tokens"
|
||||||
|
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
|
||||||
|
LITERAL_DO"/>
|
||||||
<!-- Checks for common coding problems -->
|
</module>
|
||||||
<!-- See http://checkstyle.sf.net/config_coding.html -->
|
<module name="RightCurly">
|
||||||
<!--module name="AvoidInlineConditionals"/-->
|
<property name="id" value="RightCurlyAlone"/>
|
||||||
<module name="CovariantEquals"/>
|
<property name="option" value="alone"/>
|
||||||
<module name="EmptyStatement"/>
|
<property name="tokens"
|
||||||
<!--<module name="EqualsAvoidNull"/>-->
|
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
|
||||||
<module name="EqualsHashCode"/>
|
INSTANCE_INIT, ANNOTATION_DEF"/>
|
||||||
<!--module name="HiddenField"/-->
|
</module>
|
||||||
<module name="IllegalInstantiation"/>
|
<module name="WhitespaceAround">
|
||||||
<!--module name="InnerAssignment"/-->
|
<property name="allowEmptyConstructors" value="true"/>
|
||||||
<!--module name="MagicNumber"/-->
|
<property name="allowEmptyLambdas" value="true"/>
|
||||||
<!--module name="MissingSwitchDefault"/-->
|
<property name="allowEmptyMethods" value="true"/>
|
||||||
<!--<module name="RedundantThrows"/>-->
|
<property name="allowEmptyTypes" value="true"/>
|
||||||
<module name="SimplifyBooleanExpression"/>
|
<property name="allowEmptyLoops" value="true"/>
|
||||||
<module name="SimplifyBooleanReturn"/>
|
<property name="tokens"
|
||||||
|
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR,
|
||||||
<!-- Checks for class design -->
|
BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND,
|
||||||
<!-- See http://checkstyle.sf.net/config_design.html -->
|
LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY,
|
||||||
<!--module name="DesignForExtension"/-->
|
LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED,
|
||||||
<!--<module name="FinalClass"/>-->
|
LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN,
|
||||||
<module name="HideUtilityClassConstructor"/>
|
NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR,
|
||||||
<module name="InterfaceIsType"/>
|
SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
|
||||||
<!--module name="VisibilityModifier"/-->
|
<message key="ws.notFollowed"
|
||||||
|
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
|
||||||
|
<message key="ws.notPreceded"
|
||||||
<!-- Miscellaneous other checks. -->
|
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
|
||||||
<!-- See http://checkstyle.sf.net/config_misc.html -->
|
</module>
|
||||||
|
<module name="OneStatementPerLine"/>
|
||||||
|
<module name="MultipleVariableDeclarations"/>
|
||||||
<module name="ArrayTypeStyle"/>
|
<module name="ArrayTypeStyle"/>
|
||||||
<!--module name="FinalParameters"/-->
|
<module name="MissingSwitchDefault"/>
|
||||||
<!--module name="TodoComment"/-->
|
<module name="FallThrough"/>
|
||||||
<module name="UpperEll"/>
|
<module name="UpperEll"/>
|
||||||
|
<module name="ModifierOrder"/>
|
||||||
<!-- Make the @SuppressWarnings annotations available to Checkstyle -->
|
<module name="EmptyLineSeparator">
|
||||||
<module name="SuppressWarningsHolder"/>
|
<property name="tokens"
|
||||||
|
value="PACKAGE_DEF, IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
|
||||||
|
STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
|
||||||
|
<property name="allowNoEmptyLineBetweenFields" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="SeparatorWrap">
|
||||||
|
<property name="id" value="SeparatorWrapDot"/>
|
||||||
|
<property name="tokens" value="DOT"/>
|
||||||
|
<property name="option" value="nl"/>
|
||||||
|
</module>
|
||||||
|
<module name="SeparatorWrap">
|
||||||
|
<property name="id" value="SeparatorWrapComma"/>
|
||||||
|
<property name="tokens" value="COMMA"/>
|
||||||
|
<property name="option" value="EOL"/>
|
||||||
|
</module>
|
||||||
|
<module name="SeparatorWrap">
|
||||||
|
<!-- ELLIPSIS is EOL until https://github.com/google/styleguide/issues/258 -->
|
||||||
|
<property name="id" value="SeparatorWrapEllipsis"/>
|
||||||
|
<property name="tokens" value="ELLIPSIS"/>
|
||||||
|
<property name="option" value="EOL"/>
|
||||||
|
</module>
|
||||||
|
<module name="SeparatorWrap">
|
||||||
|
<!-- ARRAY_DECLARATOR is EOL until https://github.com/google/styleguide/issues/259 -->
|
||||||
|
<property name="id" value="SeparatorWrapArrayDeclarator"/>
|
||||||
|
<property name="tokens" value="ARRAY_DECLARATOR"/>
|
||||||
|
<property name="option" value="EOL"/>
|
||||||
|
</module>
|
||||||
|
<module name="SeparatorWrap">
|
||||||
|
<property name="id" value="SeparatorWrapMethodRef"/>
|
||||||
|
<property name="tokens" value="METHOD_REF"/>
|
||||||
|
<property name="option" value="nl"/>
|
||||||
|
</module>
|
||||||
|
<module name="PackageName">
|
||||||
|
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Package name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="TypeName">
|
||||||
|
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Type name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="MemberName">
|
||||||
|
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Member name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="ParameterName">
|
||||||
|
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="LambdaParameterName">
|
||||||
|
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="CatchParameterName">
|
||||||
|
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="LocalVariableName">
|
||||||
|
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="ClassTypeParameterName">
|
||||||
|
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Class type name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="MethodTypeParameterName">
|
||||||
|
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Method type name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="InterfaceTypeParameterName">
|
||||||
|
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="NoFinalizer"/>
|
||||||
|
<module name="GenericWhitespace">
|
||||||
|
<message key="ws.followed"
|
||||||
|
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
|
||||||
|
<message key="ws.preceded"
|
||||||
|
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
|
||||||
|
<message key="ws.illegalFollow"
|
||||||
|
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
|
||||||
|
<message key="ws.notPreceded"
|
||||||
|
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
|
||||||
|
</module>
|
||||||
|
<module name="Indentation">
|
||||||
|
<property name="basicOffset" value="2"/>
|
||||||
|
<property name="braceAdjustment" value="0"/>
|
||||||
|
<property name="caseIndent" value="2"/>
|
||||||
|
<property name="throwsIndent" value="4"/>
|
||||||
|
<property name="lineWrappingIndentation" value="4"/>
|
||||||
|
<property name="arrayInitIndent" value="2"/>
|
||||||
|
</module>
|
||||||
|
<module name="AbbreviationAsWordInName">
|
||||||
|
<property name="ignoreFinal" value="false"/>
|
||||||
|
<property name="allowedAbbreviationLength" value="1"/>
|
||||||
|
<property name="tokens"
|
||||||
|
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF,
|
||||||
|
PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF"/>
|
||||||
|
</module>
|
||||||
|
<module name="OverloadMethodsDeclarationOrder"/>
|
||||||
|
<module name="VariableDeclarationUsageDistance"/>
|
||||||
|
<module name="CustomImportOrder">
|
||||||
|
<property name="sortImportsInGroupAlphabetically" value="true"/>
|
||||||
|
<property name="separateLineBetweenGroups" value="true"/>
|
||||||
|
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
|
||||||
|
<property name="tokens" value="IMPORT, STATIC_IMPORT, PACKAGE_DEF"/>
|
||||||
|
</module>
|
||||||
|
<module name="MethodParamPad">
|
||||||
|
<property name="tokens"
|
||||||
|
value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF,
|
||||||
|
SUPER_CTOR_CALL, ENUM_CONSTANT_DEF"/>
|
||||||
|
</module>
|
||||||
|
<module name="NoWhitespaceBefore">
|
||||||
|
<property name="tokens"
|
||||||
|
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
|
||||||
|
<property name="allowLineBreaks" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="ParenPad">
|
||||||
|
<property name="tokens"
|
||||||
|
value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, ENUM_CONSTANT_DEF,
|
||||||
|
EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW,
|
||||||
|
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL,
|
||||||
|
METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA"/>
|
||||||
|
</module>
|
||||||
|
<module name="OperatorWrap">
|
||||||
|
<property name="option" value="NL"/>
|
||||||
|
<property name="tokens"
|
||||||
|
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
|
||||||
|
LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
|
||||||
|
</module>
|
||||||
|
<module name="AnnotationLocation">
|
||||||
|
<property name="id" value="AnnotationLocationMostCases"/>
|
||||||
|
<property name="tokens"
|
||||||
|
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
|
||||||
|
</module>
|
||||||
|
<module name="AnnotationLocation">
|
||||||
|
<property name="id" value="AnnotationLocationVariables"/>
|
||||||
|
<property name="tokens" value="VARIABLE_DEF"/>
|
||||||
|
<property name="allowSamelineMultipleAnnotations" value="true"/>
|
||||||
|
</module>
|
||||||
|
<module name="NonEmptyAtclauseDescription"/>
|
||||||
|
<module name="InvalidJavadocPosition"/>
|
||||||
|
<module name="JavadocTagContinuationIndentation"/>
|
||||||
|
<module name="SummaryJavadoc">
|
||||||
|
<property name="forbiddenSummaryFragments"
|
||||||
|
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
|
||||||
|
</module>
|
||||||
|
<module name="JavadocParagraph"/>
|
||||||
|
<module name="AtclauseOrder">
|
||||||
|
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
|
||||||
|
<property name="target"
|
||||||
|
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
|
||||||
|
</module>
|
||||||
|
<module name="JavadocMethod">
|
||||||
|
<property name="scope" value="public"/>
|
||||||
|
<property name="allowMissingParamTags" value="true"/>
|
||||||
|
<property name="allowMissingReturnTag" value="true"/>
|
||||||
|
<property name="allowedAnnotations" value="Override, Test"/>
|
||||||
|
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF"/>
|
||||||
|
</module>
|
||||||
|
<module name="MissingJavadocMethod">
|
||||||
|
<property name="scope" value="public"/>
|
||||||
|
<property name="minLineCount" value="2"/>
|
||||||
|
<property name="allowedAnnotations" value="Override, Test"/>
|
||||||
|
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF"/>
|
||||||
|
</module>
|
||||||
|
<module name="MethodName">
|
||||||
|
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
|
||||||
|
<message key="name.invalidPattern"
|
||||||
|
value="Method name ''{0}'' must match pattern ''{1}''."/>
|
||||||
|
</module>
|
||||||
|
<module name="SingleLineJavadoc">
|
||||||
|
<property name="ignoreInlineTags" value="false"/>
|
||||||
|
</module>
|
||||||
|
<module name="EmptyCatchBlock">
|
||||||
|
<property name="exceptionVariableName" value="expected"/>
|
||||||
|
</module>
|
||||||
|
<module name="CommentsIndentation">
|
||||||
|
<property name="tokens" value="SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN"/>
|
||||||
|
</module>
|
||||||
|
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
|
||||||
|
<module name="SuppressionXpathFilter">
|
||||||
|
<property name="file" value="${org.checkstyle.google.suppressionxpathfilter.config}"
|
||||||
|
default="checkstyle-xpath-suppressions.xml" />
|
||||||
|
<property name="optional" value="true"/>
|
||||||
|
</module>
|
||||||
</module>
|
</module>
|
||||||
</module>
|
</module>
|
||||||
|
@ -33,87 +33,7 @@ task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask, dependsOn: 'jar') {
|
|||||||
includeSynthetic = true
|
includeSynthetic = true
|
||||||
packageExcludes = [
|
packageExcludes = [
|
||||||
'okhttp3.mockwebserver.internal',
|
'okhttp3.mockwebserver.internal',
|
||||||
]
|
'okhttp3.mockwebserver.internal.duplex',
|
||||||
methodExcludes = [
|
|
||||||
// Became 'final' in 4.0.0:
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getChunkSizes()',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getHandshake()',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getHeader(java.lang.String)',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getHeaders()',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getMethod()',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getPath()',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getRequestLine()',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getRequestUrl()',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getSequenceNumber()',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getTlsVersion()',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getUtf8Body()',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getBody()',
|
|
||||||
'okhttp3.mockwebserver.RecordedRequest#getBodySize()',
|
|
||||||
'okhttp3.mockwebserver.PushPromise#headers()',
|
|
||||||
'okhttp3.mockwebserver.PushPromise#method()',
|
|
||||||
'okhttp3.mockwebserver.PushPromise#path()',
|
|
||||||
'okhttp3.mockwebserver.PushPromise#response()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#addHeader(java.lang.String)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#addHeader(java.lang.String, java.lang.Object)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#addHeaderLenient(java.lang.String, java.lang.Object)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#clearHeaders()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getBody()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getBodyDelay(java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getDuplexResponseBody()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getHeadersDelay(java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getHttp2ErrorCode()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getPushPromises()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getSettings()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getSocketPolicy()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getStatus()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getThrottleBytesPerPeriod()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getThrottlePeriod(java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getTrailers()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getWebSocketListener()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#removeHeader(java.lang.String)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setBody(okio.Buffer)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setBody(java.lang.String)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setBodyDelay(long, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setChunkedBody(okio.Buffer, int)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setChunkedBody(java.lang.String, int)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setHeader(java.lang.String, java.lang.Object)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setHeaders(okhttp3.Headers)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setHeadersDelay(long, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setHttp2ErrorCode(int)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setResponseCode(int)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setSocketPolicy(okhttp3.mockwebserver.SocketPolicy)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setTrailers(okhttp3.Headers)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#throttleBody(long, long, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#withPush(okhttp3.mockwebserver.PushPromise)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#withSettings(okhttp3.internal.http2.Settings)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#withWebSocketUpgrade(okhttp3.WebSocketListener)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#getHeaders()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setStatus(java.lang.String)',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#isDuplex()',
|
|
||||||
'okhttp3.mockwebserver.MockResponse#setBody(okhttp3.mockwebserver.internal.duplex.DuplexResponseBody)',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#enqueue(okhttp3.mockwebserver.MockResponse)',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#getDispatcher()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#getHostName()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#getPort()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#getRequestCount()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#noClientAuth()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#protocols()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#requestClientAuth()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#requireClientAuth()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#setBodyLimit(long)',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#setDispatcher(okhttp3.mockwebserver.Dispatcher)',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#setProtocolNegotiationEnabled(boolean)',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#setProtocols(java.util.List)',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#setServerSocketFactory(javax.net.ServerSocketFactory)',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#shutdown()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#start()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#start(int)',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#start(java.net.InetAddress, int)',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#takeRequest()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#takeRequest(long, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#toProxyAddress()',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#url(java.lang.String)',
|
|
||||||
'okhttp3.mockwebserver.MockWebServer#useHttps(javax.net.ssl.SSLSocketFactory, boolean)',
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
check.dependsOn(japicmp)
|
check.dependsOn(japicmp)
|
||||||
|
@ -15,13 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.mockwebserver
|
package okhttp3.mockwebserver
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.WebSocketListener
|
import okhttp3.WebSocketListener
|
||||||
import okhttp3.internal.addHeaderLenient
|
import okhttp3.internal.addHeaderLenient
|
||||||
import okhttp3.internal.http2.Settings
|
import okhttp3.internal.http2.Settings
|
||||||
import okhttp3.mockwebserver.internal.duplex.DuplexResponseBody
|
import okhttp3.mockwebserver.internal.duplex.DuplexResponseBody
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
/** A scripted response to be replayed by the mock web server. */
|
/** A scripted response to be replayed by the mock web server. */
|
||||||
class MockResponse : Cloneable {
|
class MockResponse : Cloneable {
|
||||||
|
@ -17,6 +17,33 @@
|
|||||||
|
|
||||||
package okhttp3.mockwebserver
|
package okhttp3.mockwebserver
|
||||||
|
|
||||||
|
import java.io.Closeable
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.InetAddress
|
||||||
|
import java.net.InetSocketAddress
|
||||||
|
import java.net.ProtocolException
|
||||||
|
import java.net.Proxy
|
||||||
|
import java.net.ServerSocket
|
||||||
|
import java.net.Socket
|
||||||
|
import java.net.SocketException
|
||||||
|
import java.security.SecureRandom
|
||||||
|
import java.security.cert.CertificateException
|
||||||
|
import java.security.cert.X509Certificate
|
||||||
|
import java.util.Collections
|
||||||
|
import java.util.Locale
|
||||||
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
|
import java.util.concurrent.CountDownLatch
|
||||||
|
import java.util.concurrent.LinkedBlockingQueue
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger
|
||||||
|
import java.util.logging.Level
|
||||||
|
import java.util.logging.Logger
|
||||||
|
import javax.net.ServerSocketFactory
|
||||||
|
import javax.net.ssl.SSLContext
|
||||||
|
import javax.net.ssl.SSLSocket
|
||||||
|
import javax.net.ssl.SSLSocketFactory
|
||||||
|
import javax.net.ssl.TrustManager
|
||||||
|
import javax.net.ssl.X509TrustManager
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.Headers.Companion.headersOf
|
import okhttp3.Headers.Companion.headersOf
|
||||||
import okhttp3.HttpUrl
|
import okhttp3.HttpUrl
|
||||||
@ -64,33 +91,6 @@ import okio.buffer
|
|||||||
import okio.sink
|
import okio.sink
|
||||||
import okio.source
|
import okio.source
|
||||||
import org.junit.rules.ExternalResource
|
import org.junit.rules.ExternalResource
|
||||||
import java.io.Closeable
|
|
||||||
import java.io.IOException
|
|
||||||
import java.net.InetAddress
|
|
||||||
import java.net.InetSocketAddress
|
|
||||||
import java.net.ProtocolException
|
|
||||||
import java.net.Proxy
|
|
||||||
import java.net.ServerSocket
|
|
||||||
import java.net.Socket
|
|
||||||
import java.net.SocketException
|
|
||||||
import java.security.SecureRandom
|
|
||||||
import java.security.cert.CertificateException
|
|
||||||
import java.security.cert.X509Certificate
|
|
||||||
import java.util.Collections
|
|
||||||
import java.util.Locale
|
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
|
||||||
import java.util.concurrent.CountDownLatch
|
|
||||||
import java.util.concurrent.LinkedBlockingQueue
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger
|
|
||||||
import java.util.logging.Level
|
|
||||||
import java.util.logging.Logger
|
|
||||||
import javax.net.ServerSocketFactory
|
|
||||||
import javax.net.ssl.SSLContext
|
|
||||||
import javax.net.ssl.SSLSocket
|
|
||||||
import javax.net.ssl.SSLSocketFactory
|
|
||||||
import javax.net.ssl.TrustManager
|
|
||||||
import javax.net.ssl.X509TrustManager
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A scriptable web server. Callers supply canned responses and the server replays them upon request
|
* A scriptable web server. Callers supply canned responses and the server replays them upon request
|
||||||
|
@ -16,6 +16,10 @@
|
|||||||
|
|
||||||
package okhttp3.mockwebserver
|
package okhttp3.mockwebserver
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.Inet6Address
|
||||||
|
import java.net.Socket
|
||||||
|
import javax.net.ssl.SSLSocket
|
||||||
import okhttp3.Handshake
|
import okhttp3.Handshake
|
||||||
import okhttp3.Handshake.Companion.handshake
|
import okhttp3.Handshake.Companion.handshake
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
@ -23,10 +27,6 @@ import okhttp3.HttpUrl
|
|||||||
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||||
import okhttp3.TlsVersion
|
import okhttp3.TlsVersion
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
import java.io.IOException
|
|
||||||
import java.net.Inet6Address
|
|
||||||
import java.net.Socket
|
|
||||||
import javax.net.ssl.SSLSocket
|
|
||||||
|
|
||||||
/** An HTTP request that came into the mock web server. */
|
/** An HTTP request that came into the mock web server. */
|
||||||
class RecordedRequest @JvmOverloads constructor(
|
class RecordedRequest @JvmOverloads constructor(
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.mockwebserver.internal.duplex
|
package okhttp3.mockwebserver.internal.duplex
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
import okhttp3.internal.http2.Http2Stream
|
import okhttp3.internal.http2.Http2Stream
|
||||||
import okhttp3.mockwebserver.RecordedRequest
|
import okhttp3.mockwebserver.RecordedRequest
|
||||||
import java.io.IOException
|
|
||||||
|
|
||||||
interface DuplexResponseBody {
|
interface DuplexResponseBody {
|
||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
|
@ -15,6 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.mockwebserver.internal.duplex
|
package okhttp3.mockwebserver.internal.duplex
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.util.concurrent.CountDownLatch
|
||||||
|
import java.util.concurrent.FutureTask
|
||||||
|
import java.util.concurrent.LinkedBlockingQueue
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.internal.http2.ErrorCode
|
import okhttp3.internal.http2.ErrorCode
|
||||||
import okhttp3.internal.http2.Http2Stream
|
import okhttp3.internal.http2.Http2Stream
|
||||||
import okhttp3.mockwebserver.RecordedRequest
|
import okhttp3.mockwebserver.RecordedRequest
|
||||||
@ -25,11 +30,6 @@ import okio.utf8Size
|
|||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Assert.assertTrue
|
import org.junit.Assert.assertTrue
|
||||||
import org.junit.Assert.fail
|
import org.junit.Assert.fail
|
||||||
import java.io.IOException
|
|
||||||
import java.util.concurrent.CountDownLatch
|
|
||||||
import java.util.concurrent.FutureTask
|
|
||||||
import java.util.concurrent.LinkedBlockingQueue
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
private typealias Action = (RecordedRequest, BufferedSource, BufferedSink, Http2Stream) -> Unit
|
private typealias Action = (RecordedRequest, BufferedSource, BufferedSink, Http2Stream) -> Unit
|
||||||
|
|
||||||
|
@ -15,6 +15,20 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.curl
|
package okhttp3.curl
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.security.cert.X509Certificate
|
||||||
|
import java.util.Properties
|
||||||
|
import java.util.concurrent.TimeUnit.SECONDS
|
||||||
|
import java.util.logging.ConsoleHandler
|
||||||
|
import java.util.logging.Level
|
||||||
|
import java.util.logging.LogRecord
|
||||||
|
import java.util.logging.Logger
|
||||||
|
import java.util.logging.SimpleFormatter
|
||||||
|
import javax.net.ssl.HostnameVerifier
|
||||||
|
import javax.net.ssl.SSLSocketFactory
|
||||||
|
import javax.net.ssl.TrustManager
|
||||||
|
import javax.net.ssl.X509TrustManager
|
||||||
|
import kotlin.system.exitProcess
|
||||||
import okhttp3.MediaType
|
import okhttp3.MediaType
|
||||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
@ -34,20 +48,6 @@ import picocli.CommandLine.Command
|
|||||||
import picocli.CommandLine.IVersionProvider
|
import picocli.CommandLine.IVersionProvider
|
||||||
import picocli.CommandLine.Option
|
import picocli.CommandLine.Option
|
||||||
import picocli.CommandLine.Parameters
|
import picocli.CommandLine.Parameters
|
||||||
import java.io.IOException
|
|
||||||
import java.security.cert.X509Certificate
|
|
||||||
import java.util.Properties
|
|
||||||
import java.util.concurrent.TimeUnit.SECONDS
|
|
||||||
import java.util.logging.ConsoleHandler
|
|
||||||
import java.util.logging.Level
|
|
||||||
import java.util.logging.LogRecord
|
|
||||||
import java.util.logging.Logger
|
|
||||||
import java.util.logging.SimpleFormatter
|
|
||||||
import javax.net.ssl.HostnameVerifier
|
|
||||||
import javax.net.ssl.SSLSocketFactory
|
|
||||||
import javax.net.ssl.TrustManager
|
|
||||||
import javax.net.ssl.X509TrustManager
|
|
||||||
import kotlin.system.exitProcess
|
|
||||||
|
|
||||||
@Command(name = NAME, description = ["A curl for the next-generation web."],
|
@Command(name = NAME, description = ["A curl for the next-generation web."],
|
||||||
mixinStandardHelpOptions = true, versionProvider = Main.VersionProvider::class)
|
mixinStandardHelpOptions = true, versionProvider = Main.VersionProvider::class)
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.brotli
|
package okhttp3.brotli
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
import okhttp3.MediaType.Companion.toMediaType
|
import okhttp3.MediaType.Companion.toMediaType
|
||||||
import okhttp3.Protocol
|
import okhttp3.Protocol
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
@ -26,7 +27,6 @@ import okio.ByteString.Companion.encodeUtf8
|
|||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.Assert.fail
|
import org.junit.Assert.fail
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.io.IOException
|
|
||||||
|
|
||||||
class BrotliInterceptorTest {
|
class BrotliInterceptorTest {
|
||||||
@Test
|
@Test
|
||||||
|
@ -33,4 +33,4 @@ private fun sendRequest(url: String, client: OkHttpClient) {
|
|||||||
client.newCall(req).execute().use {
|
client.newCall(req).execute().use {
|
||||||
println(it.body?.string())
|
println(it.body?.string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.dnsoverhttps
|
package okhttp3.dnsoverhttps
|
||||||
|
|
||||||
import okhttp3.Dns
|
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
import java.net.UnknownHostException
|
import java.net.UnknownHostException
|
||||||
|
import okhttp3.Dns
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal Bootstrap DNS implementation for handling initial connection to DNS over HTTPS server.
|
* Internal Bootstrap DNS implementation for handling initial connection to DNS over HTTPS server.
|
||||||
|
@ -15,6 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.dnsoverhttps
|
package okhttp3.dnsoverhttps
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.InetAddress
|
||||||
|
import java.net.UnknownHostException
|
||||||
|
import java.util.ArrayList
|
||||||
|
import java.util.concurrent.CountDownLatch
|
||||||
import okhttp3.CacheControl
|
import okhttp3.CacheControl
|
||||||
import okhttp3.Call
|
import okhttp3.Call
|
||||||
import okhttp3.Callback
|
import okhttp3.Callback
|
||||||
@ -29,11 +34,6 @@ import okhttp3.RequestBody.Companion.toRequestBody
|
|||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import okhttp3.internal.platform.Platform
|
import okhttp3.internal.platform.Platform
|
||||||
import okhttp3.internal.publicsuffix.PublicSuffixDatabase
|
import okhttp3.internal.publicsuffix.PublicSuffixDatabase
|
||||||
import java.io.IOException
|
|
||||||
import java.net.InetAddress
|
|
||||||
import java.net.UnknownHostException
|
|
||||||
import java.util.ArrayList
|
|
||||||
import java.util.concurrent.CountDownLatch
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [DNS over HTTPS implementation][doh_spec].
|
* [DNS over HTTPS implementation][doh_spec].
|
||||||
|
@ -15,13 +15,13 @@
|
|||||||
|
|
||||||
package okhttp3.dnsoverhttps
|
package okhttp3.dnsoverhttps
|
||||||
|
|
||||||
import okio.Buffer
|
|
||||||
import okio.ByteString
|
|
||||||
import okio.utf8Size
|
|
||||||
import java.io.EOFException
|
import java.io.EOFException
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
import java.net.UnknownHostException
|
import java.net.UnknownHostException
|
||||||
import java.nio.charset.StandardCharsets
|
import java.nio.charset.StandardCharsets
|
||||||
|
import okio.Buffer
|
||||||
|
import okio.ByteString
|
||||||
|
import okio.utf8Size
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trivial Dns Encoder/Decoder, basically ripped from Netty full implementation.
|
* Trivial Dns Encoder/Decoder, basically ripped from Netty full implementation.
|
||||||
|
@ -34,11 +34,5 @@ task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask, dependsOn: 'jar') {
|
|||||||
txtOutputFile = file("$buildDir/reports/japi.txt")
|
txtOutputFile = file("$buildDir/reports/japi.txt")
|
||||||
ignoreMissingClasses = true
|
ignoreMissingClasses = true
|
||||||
includeSynthetic = true
|
includeSynthetic = true
|
||||||
methodExcludes = [
|
|
||||||
// Became 'final' in 4.0.0:
|
|
||||||
'okhttp3.logging.HttpLoggingInterceptor#redactHeader(java.lang.String)',
|
|
||||||
'okhttp3.logging.HttpLoggingInterceptor#getLevel()',
|
|
||||||
'okhttp3.logging.HttpLoggingInterceptor#setLevel(okhttp3.logging.HttpLoggingInterceptor$Level)'
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
check.dependsOn(japicmp)
|
check.dependsOn(japicmp)
|
||||||
|
@ -15,6 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.logging
|
package okhttp3.logging
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.nio.charset.Charset
|
||||||
|
import java.nio.charset.StandardCharsets.UTF_8
|
||||||
|
import java.util.TreeSet
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
@ -23,11 +28,6 @@ import okhttp3.internal.http.promisesBody
|
|||||||
import okhttp3.internal.platform.Platform
|
import okhttp3.internal.platform.Platform
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
import okio.GzipSource
|
import okio.GzipSource
|
||||||
import java.io.IOException
|
|
||||||
import java.nio.charset.Charset
|
|
||||||
import java.nio.charset.StandardCharsets.UTF_8
|
|
||||||
import java.util.TreeSet
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An OkHttp interceptor which logs request and response information. Can be applied as an
|
* An OkHttp interceptor which logs request and response information. Can be applied as an
|
||||||
|
@ -15,6 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.logging
|
package okhttp3.logging
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.InetAddress
|
||||||
|
import java.net.InetSocketAddress
|
||||||
|
import java.net.Proxy
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.Call
|
import okhttp3.Call
|
||||||
import okhttp3.Connection
|
import okhttp3.Connection
|
||||||
import okhttp3.EventListener
|
import okhttp3.EventListener
|
||||||
@ -24,11 +29,6 @@ import okhttp3.OkHttpClient
|
|||||||
import okhttp3.Protocol
|
import okhttp3.Protocol
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import java.io.IOException
|
|
||||||
import java.net.InetAddress
|
|
||||||
import java.net.InetSocketAddress
|
|
||||||
import java.net.Proxy
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An OkHttp EventListener, which logs call events. Can be applied as an
|
* An OkHttp EventListener, which logs call events. Can be applied as an
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.logging
|
package okhttp3.logging
|
||||||
|
|
||||||
import okio.Buffer
|
|
||||||
import java.io.EOFException
|
import java.io.EOFException
|
||||||
|
import okio.Buffer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the body in question probably contains human readable text. Uses a small
|
* Returns true if the body in question probably contains human readable text. Uses a small
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.sse
|
package okhttp3.internal.sse
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
import okhttp3.Call
|
import okhttp3.Call
|
||||||
import okhttp3.Callback
|
import okhttp3.Callback
|
||||||
import okhttp3.EventListener
|
import okhttp3.EventListener
|
||||||
@ -26,7 +27,6 @@ import okhttp3.internal.EMPTY_RESPONSE
|
|||||||
import okhttp3.internal.connection.Exchange
|
import okhttp3.internal.connection.Exchange
|
||||||
import okhttp3.sse.EventSource
|
import okhttp3.sse.EventSource
|
||||||
import okhttp3.sse.EventSourceListener
|
import okhttp3.sse.EventSourceListener
|
||||||
import java.io.IOException
|
|
||||||
|
|
||||||
class RealEventSource(
|
class RealEventSource(
|
||||||
private val request: Request,
|
private val request: Request,
|
||||||
|
@ -15,12 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.sse
|
package okhttp3.internal.sse
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
import okhttp3.internal.toLongOrDefault
|
import okhttp3.internal.toLongOrDefault
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
import okio.BufferedSource
|
import okio.BufferedSource
|
||||||
import okio.ByteString.Companion.encodeUtf8
|
import okio.ByteString.Companion.encodeUtf8
|
||||||
import okio.Options
|
import okio.Options
|
||||||
import java.io.IOException
|
|
||||||
|
|
||||||
class ServerSentEventReader(
|
class ServerSentEventReader(
|
||||||
private val source: BufferedSource,
|
private val source: BufferedSource,
|
||||||
|
@ -15,15 +15,15 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.net.InetAddress
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
import java.util.logging.Logger
|
||||||
import okhttp3.internal.concurrent.TaskRunner
|
import okhttp3.internal.concurrent.TaskRunner
|
||||||
import okhttp3.testing.Flaky
|
import okhttp3.testing.Flaky
|
||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.junit.rules.TestRule
|
import org.junit.rules.TestRule
|
||||||
import org.junit.runner.Description
|
import org.junit.runner.Description
|
||||||
import org.junit.runners.model.Statement
|
import org.junit.runners.model.Statement
|
||||||
import java.net.InetAddress
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
import java.util.logging.Logger
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply this rule to all tests. It adds additional checks for leaked resources and uncaught
|
* Apply this rule to all tests. It adds additional checks for leaked resources and uncaught
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
import okhttp3.internal.concurrent.TaskRunner
|
|
||||||
import okhttp3.internal.http2.Http2
|
|
||||||
import java.util.concurrent.CopyOnWriteArraySet
|
import java.util.concurrent.CopyOnWriteArraySet
|
||||||
import java.util.logging.ConsoleHandler
|
import java.util.logging.ConsoleHandler
|
||||||
import java.util.logging.Level
|
import java.util.logging.Level
|
||||||
@ -24,6 +22,8 @@ import java.util.logging.LogRecord
|
|||||||
import java.util.logging.Logger
|
import java.util.logging.Logger
|
||||||
import java.util.logging.SimpleFormatter
|
import java.util.logging.SimpleFormatter
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
|
import okhttp3.internal.concurrent.TaskRunner
|
||||||
|
import okhttp3.internal.http2.Http2
|
||||||
|
|
||||||
object OkHttpDebugLogging {
|
object OkHttpDebugLogging {
|
||||||
// Keep references to loggers to prevent their configuration from being GC'd.
|
// Keep references to loggers to prevent their configuration from being GC'd.
|
||||||
|
@ -15,6 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.InetAddress
|
||||||
|
import java.net.InetSocketAddress
|
||||||
|
import java.net.Proxy
|
||||||
|
import java.util.Deque
|
||||||
|
import java.util.concurrent.ConcurrentLinkedDeque
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.CallEvent.CallEnd
|
import okhttp3.CallEvent.CallEnd
|
||||||
import okhttp3.CallEvent.CallFailed
|
import okhttp3.CallEvent.CallFailed
|
||||||
import okhttp3.CallEvent.CallStart
|
import okhttp3.CallEvent.CallStart
|
||||||
@ -42,13 +49,6 @@ import okhttp3.CallEvent.SecureConnectStart
|
|||||||
import org.assertj.core.api.Assertions.assertThat
|
import org.assertj.core.api.Assertions.assertThat
|
||||||
import org.assertj.core.data.Offset
|
import org.assertj.core.data.Offset
|
||||||
import org.junit.Assert.assertTrue
|
import org.junit.Assert.assertTrue
|
||||||
import java.io.IOException
|
|
||||||
import java.net.InetAddress
|
|
||||||
import java.net.InetSocketAddress
|
|
||||||
import java.net.Proxy
|
|
||||||
import java.util.Deque
|
|
||||||
import java.util.concurrent.ConcurrentLinkedDeque
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
open class RecordingEventListener : EventListener() {
|
open class RecordingEventListener : EventListener() {
|
||||||
val eventSequence: Deque<CallEvent> = ConcurrentLinkedDeque()
|
val eventSequence: Deque<CallEvent> = ConcurrentLinkedDeque()
|
||||||
|
@ -15,12 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.testing
|
package okhttp3.testing
|
||||||
|
|
||||||
|
import com.amazon.corretto.crypto.provider.AmazonCorrettoCryptoProvider
|
||||||
|
import com.amazon.corretto.crypto.provider.SelfTestStatus
|
||||||
|
import java.security.Security
|
||||||
import okhttp3.internal.platform.ConscryptPlatform
|
import okhttp3.internal.platform.ConscryptPlatform
|
||||||
import okhttp3.internal.platform.Jdk8WithJettyBootPlatform
|
import okhttp3.internal.platform.Jdk8WithJettyBootPlatform
|
||||||
import okhttp3.internal.platform.Jdk9Platform
|
import okhttp3.internal.platform.Jdk9Platform
|
||||||
import okhttp3.internal.platform.OpenJSSEPlatform
|
import okhttp3.internal.platform.OpenJSSEPlatform
|
||||||
import com.amazon.corretto.crypto.provider.AmazonCorrettoCryptoProvider
|
|
||||||
import com.amazon.corretto.crypto.provider.SelfTestStatus
|
|
||||||
import okhttp3.internal.platform.Platform
|
import okhttp3.internal.platform.Platform
|
||||||
import org.bouncycastle.jce.provider.BouncyCastleProvider
|
import org.bouncycastle.jce.provider.BouncyCastleProvider
|
||||||
import org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
|
import org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
|
||||||
@ -40,7 +41,6 @@ import org.junit.AssumptionViolatedException
|
|||||||
import org.junit.rules.TestRule
|
import org.junit.rules.TestRule
|
||||||
import org.junit.runners.model.Statement
|
import org.junit.runners.model.Statement
|
||||||
import org.openjsse.net.ssl.OpenJSSE
|
import org.openjsse.net.ssl.OpenJSSE
|
||||||
import java.security.Security
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks a test as Platform aware, before the test runs a consistent Platform will be
|
* Marks a test as Platform aware, before the test runs a consistent Platform will be
|
||||||
@ -380,4 +380,4 @@ open class PlatformRule @JvmOverloads constructor(
|
|||||||
val isCorrettoInstalled: Boolean =
|
val isCorrettoInstalled: Boolean =
|
||||||
isCorrettoSupported && Security.getProviders().first().name == AmazonCorrettoCryptoProvider.PROVIDER_NAME
|
isCorrettoSupported && Security.getProviders().first().name == AmazonCorrettoCryptoProvider.PROVIDER_NAME
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,4 +26,4 @@ object PlatformVersion {
|
|||||||
fun getJvmSpecVersion(): String {
|
fun getJvmSpecVersion(): String {
|
||||||
return System.getProperty("java.specification.version", "unknown")
|
return System.getProperty("java.specification.version", "unknown")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,4 +47,4 @@ class PlatformRuleTest {
|
|||||||
|
|
||||||
check(false)
|
check(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,35 +36,5 @@ task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask, dependsOn: 'jar') {
|
|||||||
packageExcludes = [
|
packageExcludes = [
|
||||||
'okhttp3.tls.internal',
|
'okhttp3.tls.internal',
|
||||||
]
|
]
|
||||||
methodExcludes = [
|
|
||||||
// Became 'final' in 4.0.0:
|
|
||||||
'okhttp3.tls.HandshakeCertificates#keyManager()',
|
|
||||||
'okhttp3.tls.HandshakeCertificates#sslContext()',
|
|
||||||
'okhttp3.tls.HandshakeCertificates#sslSocketFactory()',
|
|
||||||
'okhttp3.tls.HandshakeCertificates#trustManager()',
|
|
||||||
'okhttp3.tls.HandshakeCertificates$Builder#addPlatformTrustedCertificates()',
|
|
||||||
'okhttp3.tls.HandshakeCertificates$Builder#addTrustedCertificate(java.security.cert.X509Certificate)',
|
|
||||||
'okhttp3.tls.HandshakeCertificates$Builder#build()',
|
|
||||||
'okhttp3.tls.HandshakeCertificates$Builder#heldCertificate(okhttp3.tls.HeldCertificate, java.security.cert.X509Certificate\\[\\])',
|
|
||||||
'okhttp3.tls.HeldCertificate#certificate()',
|
|
||||||
'okhttp3.tls.HeldCertificate#certificatePem()',
|
|
||||||
'okhttp3.tls.HeldCertificate#keyPair()',
|
|
||||||
'okhttp3.tls.HeldCertificate#privateKeyPkcs1Pem()',
|
|
||||||
'okhttp3.tls.HeldCertificate#privateKeyPkcs8Pem()',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#addSubjectAlternativeName(java.lang.String)',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#build()',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#certificateAuthority(int)',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#commonName(java.lang.String)',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#duration(long, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#ecdsa256()',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#keyPair(java.security.KeyPair)',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#keyPair(java.security.PublicKey, java.security.PrivateKey)',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#organizationalUnit(java.lang.String)',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#rsa2048()',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#serialNumber(java.math.BigInteger)',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#serialNumber(long)',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#signedBy(okhttp3.tls.HeldCertificate)',
|
|
||||||
'okhttp3.tls.HeldCertificate$Builder#validityInterval(long, long)',
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
check.dependsOn(japicmp)
|
check.dependsOn(japicmp)
|
||||||
|
@ -15,10 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.tls
|
package okhttp3.tls
|
||||||
|
|
||||||
import okhttp3.CertificatePinner
|
|
||||||
import okhttp3.internal.platform.Platform
|
|
||||||
import okhttp3.tls.internal.TlsUtil.newKeyManager
|
|
||||||
import okhttp3.tls.internal.TlsUtil.newTrustManager
|
|
||||||
import java.security.SecureRandom
|
import java.security.SecureRandom
|
||||||
import java.security.cert.X509Certificate
|
import java.security.cert.X509Certificate
|
||||||
import java.util.Collections
|
import java.util.Collections
|
||||||
@ -28,6 +24,10 @@ import javax.net.ssl.SSLSocketFactory
|
|||||||
import javax.net.ssl.TrustManager
|
import javax.net.ssl.TrustManager
|
||||||
import javax.net.ssl.X509KeyManager
|
import javax.net.ssl.X509KeyManager
|
||||||
import javax.net.ssl.X509TrustManager
|
import javax.net.ssl.X509TrustManager
|
||||||
|
import okhttp3.CertificatePinner
|
||||||
|
import okhttp3.internal.platform.Platform
|
||||||
|
import okhttp3.tls.internal.TlsUtil.newKeyManager
|
||||||
|
import okhttp3.tls.internal.TlsUtil.newTrustManager
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Certificates to identify which peers to trust and also to earn the trust of those peers in kind.
|
* Certificates to identify which peers to trust and also to earn the trust of those peers in kind.
|
||||||
|
@ -15,19 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.tls
|
package okhttp3.tls
|
||||||
|
|
||||||
import okhttp3.internal.canParseAsIpAddress
|
|
||||||
import okio.Buffer
|
|
||||||
import okio.ByteString
|
|
||||||
import okio.ByteString.Companion.decodeBase64
|
|
||||||
import okio.ByteString.Companion.toByteString
|
|
||||||
import org.bouncycastle.asn1.ASN1Encodable
|
|
||||||
import org.bouncycastle.asn1.DERSequence
|
|
||||||
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo
|
|
||||||
import org.bouncycastle.asn1.x509.BasicConstraints
|
|
||||||
import org.bouncycastle.asn1.x509.GeneralName
|
|
||||||
import org.bouncycastle.asn1.x509.X509Extensions
|
|
||||||
import org.bouncycastle.jce.provider.BouncyCastleProvider
|
|
||||||
import org.bouncycastle.x509.X509V3CertificateGenerator
|
|
||||||
import java.math.BigInteger
|
import java.math.BigInteger
|
||||||
import java.security.GeneralSecurityException
|
import java.security.GeneralSecurityException
|
||||||
import java.security.KeyFactory
|
import java.security.KeyFactory
|
||||||
@ -47,6 +34,19 @@ import java.util.Date
|
|||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import javax.security.auth.x500.X500Principal
|
import javax.security.auth.x500.X500Principal
|
||||||
|
import okhttp3.internal.canParseAsIpAddress
|
||||||
|
import okio.Buffer
|
||||||
|
import okio.ByteString
|
||||||
|
import okio.ByteString.Companion.decodeBase64
|
||||||
|
import okio.ByteString.Companion.toByteString
|
||||||
|
import org.bouncycastle.asn1.ASN1Encodable
|
||||||
|
import org.bouncycastle.asn1.DERSequence
|
||||||
|
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo
|
||||||
|
import org.bouncycastle.asn1.x509.BasicConstraints
|
||||||
|
import org.bouncycastle.asn1.x509.GeneralName
|
||||||
|
import org.bouncycastle.asn1.x509.X509Extensions
|
||||||
|
import org.bouncycastle.jce.provider.BouncyCastleProvider
|
||||||
|
import org.bouncycastle.x509.X509V3CertificateGenerator
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A certificate and its private key. These are some properties of certificates that are used with
|
* A certificate and its private key. These are some properties of certificates that are used with
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.tls.internal
|
package okhttp3.tls.internal
|
||||||
|
|
||||||
import okhttp3.tls.HandshakeCertificates
|
|
||||||
import okhttp3.tls.HeldCertificate
|
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
import java.security.KeyStore
|
import java.security.KeyStore
|
||||||
@ -26,6 +24,8 @@ import javax.net.ssl.KeyManagerFactory
|
|||||||
import javax.net.ssl.TrustManagerFactory
|
import javax.net.ssl.TrustManagerFactory
|
||||||
import javax.net.ssl.X509KeyManager
|
import javax.net.ssl.X509KeyManager
|
||||||
import javax.net.ssl.X509TrustManager
|
import javax.net.ssl.X509TrustManager
|
||||||
|
import okhttp3.tls.HandshakeCertificates
|
||||||
|
import okhttp3.tls.HeldCertificate
|
||||||
|
|
||||||
object TlsUtil {
|
object TlsUtil {
|
||||||
val password = "password".toCharArray()
|
val password = "password".toCharArray()
|
||||||
|
@ -15,15 +15,15 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.CookieHandler
|
||||||
|
import java.net.HttpCookie
|
||||||
|
import java.util.Collections
|
||||||
import okhttp3.internal.cookieToString
|
import okhttp3.internal.cookieToString
|
||||||
import okhttp3.internal.delimiterOffset
|
import okhttp3.internal.delimiterOffset
|
||||||
import okhttp3.internal.platform.Platform
|
import okhttp3.internal.platform.Platform
|
||||||
import okhttp3.internal.platform.Platform.Companion.WARN
|
import okhttp3.internal.platform.Platform.Companion.WARN
|
||||||
import okhttp3.internal.trimSubstring
|
import okhttp3.internal.trimSubstring
|
||||||
import java.io.IOException
|
|
||||||
import java.net.CookieHandler
|
|
||||||
import java.net.HttpCookie
|
|
||||||
import java.util.Collections
|
|
||||||
|
|
||||||
/** A cookie jar that delegates to a [java.net.CookieHandler]. */
|
/** A cookie jar that delegates to a [java.net.CookieHandler]. */
|
||||||
class JavaNetCookieJar(private val cookieHandler: CookieHandler) : CookieJar {
|
class JavaNetCookieJar(private val cookieHandler: CookieHandler) : CookieJar {
|
||||||
|
@ -64,6 +64,18 @@ task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask, dependsOn: 'jar') {
|
|||||||
includeSynthetic = true
|
includeSynthetic = true
|
||||||
packageExcludes = [
|
packageExcludes = [
|
||||||
'okhttp3.internal',
|
'okhttp3.internal',
|
||||||
|
'okhttp3.internal.annotations',
|
||||||
|
'okhttp3.internal.cache',
|
||||||
|
'okhttp3.internal.cache2',
|
||||||
|
'okhttp3.internal.connection',
|
||||||
|
'okhttp3.internal.http',
|
||||||
|
'okhttp3.internal.http2',
|
||||||
|
'okhttp3.internal.io',
|
||||||
|
'okhttp3.internal.platform',
|
||||||
|
'okhttp3.internal.proxy',
|
||||||
|
'okhttp3.internal.publicsuffix',
|
||||||
|
'okhttp3.internal.tls',
|
||||||
|
'okhttp3.internal.ws',
|
||||||
]
|
]
|
||||||
classExcludes = [
|
classExcludes = [
|
||||||
// Package-private in 3.x, internal in 4.0.0:
|
// Package-private in 3.x, internal in 4.0.0:
|
||||||
@ -71,303 +83,7 @@ task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask, dependsOn: 'jar') {
|
|||||||
'okhttp3.RealCall$AsyncCall',
|
'okhttp3.RealCall$AsyncCall',
|
||||||
]
|
]
|
||||||
methodExcludes = [
|
methodExcludes = [
|
||||||
// Became 'final' in 4.0.0:
|
// Became 'final' despite a non-final enclosing class in 4.0.0:
|
||||||
'okhttp3.Address#certificatePinner()',
|
|
||||||
'okhttp3.Address#connectionSpecs()',
|
|
||||||
'okhttp3.Address#dns()',
|
|
||||||
'okhttp3.Address#hostnameVerifier()',
|
|
||||||
'okhttp3.Address#protocols()',
|
|
||||||
'okhttp3.Address#proxy()',
|
|
||||||
'okhttp3.Address#proxyAuthenticator()',
|
|
||||||
'okhttp3.Address#proxySelector()',
|
|
||||||
'okhttp3.Address#socketFactory()',
|
|
||||||
'okhttp3.Address#sslSocketFactory()',
|
|
||||||
'okhttp3.Address#url()',
|
|
||||||
'okhttp3.Cache#delete()',
|
|
||||||
'okhttp3.Cache#directory()',
|
|
||||||
'okhttp3.Cache#evictAll()',
|
|
||||||
'okhttp3.Cache#hitCount()',
|
|
||||||
'okhttp3.Cache#initialize()',
|
|
||||||
'okhttp3.Cache#isClosed()',
|
|
||||||
'okhttp3.Cache#maxSize()',
|
|
||||||
'okhttp3.Cache#networkCount()',
|
|
||||||
'okhttp3.Cache#requestCount()',
|
|
||||||
'okhttp3.Cache#size()',
|
|
||||||
'okhttp3.Cache#urls()',
|
|
||||||
'okhttp3.Cache#writeAbortCount()',
|
|
||||||
'okhttp3.Cache#writeSuccessCount()',
|
|
||||||
'okhttp3.CacheControl#immutable()',
|
|
||||||
'okhttp3.CacheControl#isPrivate()',
|
|
||||||
'okhttp3.CacheControl#isPublic()',
|
|
||||||
'okhttp3.CacheControl#maxAgeSeconds()',
|
|
||||||
'okhttp3.CacheControl#maxStaleSeconds()',
|
|
||||||
'okhttp3.CacheControl#minFreshSeconds()',
|
|
||||||
'okhttp3.CacheControl#mustRevalidate()',
|
|
||||||
'okhttp3.CacheControl#noCache()',
|
|
||||||
'okhttp3.CacheControl#noStore()',
|
|
||||||
'okhttp3.CacheControl#noTransform()',
|
|
||||||
'okhttp3.CacheControl#onlyIfCached()',
|
|
||||||
'okhttp3.CacheControl#sMaxAgeSeconds()',
|
|
||||||
'okhttp3.CacheControl$Builder#build()',
|
|
||||||
'okhttp3.CacheControl$Builder#immutable()',
|
|
||||||
'okhttp3.CacheControl$Builder#maxAge(int, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.CacheControl$Builder#maxStale(int, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.CacheControl$Builder#minFresh(int, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.CacheControl$Builder#noCache()',
|
|
||||||
'okhttp3.CacheControl$Builder#noStore()',
|
|
||||||
'okhttp3.CacheControl$Builder#noTransform()',
|
|
||||||
'okhttp3.CacheControl$Builder#onlyIfCached()',
|
|
||||||
'okhttp3.CertificatePinner#check(java.lang.String, java.security.cert.Certificate\\[\\])',
|
|
||||||
'okhttp3.CertificatePinner#check(java.lang.String, java.util.List)',
|
|
||||||
'okhttp3.CertificatePinner$Builder#add(java.lang.String, java.lang.String\\[\\])',
|
|
||||||
'okhttp3.CertificatePinner$Builder#build()',
|
|
||||||
'okhttp3.CertificatePinner$Pin#matches(java.lang.String)',
|
|
||||||
'okhttp3.Challenge#authParams()',
|
|
||||||
'okhttp3.Challenge#charset()',
|
|
||||||
'okhttp3.Challenge#realm()',
|
|
||||||
'okhttp3.Challenge#scheme()',
|
|
||||||
'okhttp3.Challenge#withCharset(java.nio.charset.Charset)',
|
|
||||||
'okhttp3.CipherSuite#javaName()',
|
|
||||||
'okhttp3.ConnectionPool#connectionCount()',
|
|
||||||
'okhttp3.ConnectionPool#evictAll()',
|
|
||||||
'okhttp3.ConnectionPool#idleConnectionCount()',
|
|
||||||
'okhttp3.ConnectionSpec#cipherSuites()',
|
|
||||||
'okhttp3.ConnectionSpec#isCompatible(javax.net.ssl.SSLSocket)',
|
|
||||||
'okhttp3.ConnectionSpec#isTls()',
|
|
||||||
'okhttp3.ConnectionSpec#supportsTlsExtensions()',
|
|
||||||
'okhttp3.ConnectionSpec#tlsVersions()',
|
|
||||||
'okhttp3.ConnectionSpec$Builder#allEnabledCipherSuites()',
|
|
||||||
'okhttp3.ConnectionSpec$Builder#allEnabledTlsVersions()',
|
|
||||||
'okhttp3.ConnectionSpec$Builder#build()',
|
|
||||||
'okhttp3.ConnectionSpec$Builder#cipherSuites(java.lang.String\\[\\])',
|
|
||||||
'okhttp3.ConnectionSpec$Builder#cipherSuites(okhttp3.CipherSuite\\[\\])',
|
|
||||||
'okhttp3.ConnectionSpec$Builder#supportsTlsExtensions(boolean)',
|
|
||||||
'okhttp3.ConnectionSpec$Builder#tlsVersions(java.lang.String\\[\\])',
|
|
||||||
'okhttp3.ConnectionSpec$Builder#tlsVersions(okhttp3.TlsVersion\\[\\])',
|
|
||||||
'okhttp3.Cookie#domain()',
|
|
||||||
'okhttp3.Cookie#expiresAt()',
|
|
||||||
'okhttp3.Cookie#hostOnly()',
|
|
||||||
'okhttp3.Cookie#httpOnly()',
|
|
||||||
'okhttp3.Cookie#matches(okhttp3.HttpUrl)',
|
|
||||||
'okhttp3.Cookie#name()',
|
|
||||||
'okhttp3.Cookie#path()',
|
|
||||||
'okhttp3.Cookie#persistent()',
|
|
||||||
'okhttp3.Cookie#secure()',
|
|
||||||
'okhttp3.Cookie#value()',
|
|
||||||
'okhttp3.Cookie$Builder#build()',
|
|
||||||
'okhttp3.Cookie$Builder#domain(java.lang.String)',
|
|
||||||
'okhttp3.Cookie$Builder#expiresAt(long)',
|
|
||||||
'okhttp3.Cookie$Builder#hostOnlyDomain(java.lang.String)',
|
|
||||||
'okhttp3.Cookie$Builder#httpOnly()',
|
|
||||||
'okhttp3.Cookie$Builder#name(java.lang.String)',
|
|
||||||
'okhttp3.Cookie$Builder#path(java.lang.String)',
|
|
||||||
'okhttp3.Cookie$Builder#secure()',
|
|
||||||
'okhttp3.Cookie$Builder#value(java.lang.String)',
|
|
||||||
'okhttp3.Dispatcher#cancelAll()',
|
|
||||||
'okhttp3.Dispatcher#executorService()',
|
|
||||||
'okhttp3.Dispatcher#getMaxRequests()',
|
|
||||||
'okhttp3.Dispatcher#getMaxRequestsPerHost()',
|
|
||||||
'okhttp3.Dispatcher#queuedCalls()',
|
|
||||||
'okhttp3.Dispatcher#queuedCallsCount()',
|
|
||||||
'okhttp3.Dispatcher#runningCalls()',
|
|
||||||
'okhttp3.Dispatcher#runningCallsCount()',
|
|
||||||
'okhttp3.Dispatcher#setIdleCallback(java.lang.Runnable)',
|
|
||||||
'okhttp3.Dispatcher#setMaxRequests(int)',
|
|
||||||
'okhttp3.Dispatcher#setMaxRequestsPerHost(int)',
|
|
||||||
'okhttp3.FormBody#encodedName(int)',
|
|
||||||
'okhttp3.FormBody#encodedValue(int)',
|
|
||||||
'okhttp3.FormBody#name(int)',
|
|
||||||
'okhttp3.FormBody#size()',
|
|
||||||
'okhttp3.FormBody#value(int)',
|
|
||||||
'okhttp3.FormBody$Builder#add(java.lang.String, java.lang.String)',
|
|
||||||
'okhttp3.FormBody$Builder#addEncoded(java.lang.String, java.lang.String)',
|
|
||||||
'okhttp3.FormBody$Builder#build()',
|
|
||||||
'okhttp3.Handshake#cipherSuite()',
|
|
||||||
'okhttp3.Handshake#localCertificates()',
|
|
||||||
'okhttp3.Handshake#localPrincipal()',
|
|
||||||
'okhttp3.Handshake#peerCertificates()',
|
|
||||||
'okhttp3.Handshake#peerPrincipal()',
|
|
||||||
'okhttp3.Handshake#tlsVersion()',
|
|
||||||
'okhttp3.Headers#byteCount()',
|
|
||||||
'okhttp3.Headers#get(java.lang.String)',
|
|
||||||
'okhttp3.Headers#getDate(java.lang.String)',
|
|
||||||
'okhttp3.Headers#getInstant(java.lang.String)',
|
|
||||||
'okhttp3.Headers#name(int)',
|
|
||||||
'okhttp3.Headers#names()',
|
|
||||||
'okhttp3.Headers#newBuilder()',
|
|
||||||
'okhttp3.Headers#size()',
|
|
||||||
'okhttp3.Headers#toMultimap()',
|
|
||||||
'okhttp3.Headers#value(int)',
|
|
||||||
'okhttp3.Headers#values(java.lang.String)',
|
|
||||||
'okhttp3.Headers$Builder#add(java.lang.String)',
|
|
||||||
'okhttp3.Headers$Builder#add(java.lang.String, java.lang.String)',
|
|
||||||
'okhttp3.Headers$Builder#add(java.lang.String, java.time.Instant)',
|
|
||||||
'okhttp3.Headers$Builder#add(java.lang.String, java.util.Date)',
|
|
||||||
'okhttp3.Headers$Builder#addAll(okhttp3.Headers)',
|
|
||||||
'okhttp3.Headers$Builder#addUnsafeNonAscii(java.lang.String, java.lang.String)',
|
|
||||||
'okhttp3.Headers$Builder#build()',
|
|
||||||
'okhttp3.Headers$Builder#get(java.lang.String)',
|
|
||||||
'okhttp3.Headers$Builder#removeAll(java.lang.String)',
|
|
||||||
'okhttp3.Headers$Builder#set(java.lang.String, java.lang.String)',
|
|
||||||
'okhttp3.Headers$Builder#set(java.lang.String, java.time.Instant)',
|
|
||||||
'okhttp3.Headers$Builder#set(java.lang.String, java.util.Date)',
|
|
||||||
'okhttp3.HttpUrl#encodedFragment()',
|
|
||||||
'okhttp3.HttpUrl#encodedPassword()',
|
|
||||||
'okhttp3.HttpUrl#encodedPath()',
|
|
||||||
'okhttp3.HttpUrl#encodedPathSegments()',
|
|
||||||
'okhttp3.HttpUrl#encodedQuery()',
|
|
||||||
'okhttp3.HttpUrl#encodedUsername()',
|
|
||||||
'okhttp3.HttpUrl#fragment()',
|
|
||||||
'okhttp3.HttpUrl#host()',
|
|
||||||
'okhttp3.HttpUrl#isHttps()',
|
|
||||||
'okhttp3.HttpUrl#newBuilder()',
|
|
||||||
'okhttp3.HttpUrl#newBuilder(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl#password()',
|
|
||||||
'okhttp3.HttpUrl#pathSegments()',
|
|
||||||
'okhttp3.HttpUrl#pathSize()',
|
|
||||||
'okhttp3.HttpUrl#port()',
|
|
||||||
'okhttp3.HttpUrl#query()',
|
|
||||||
'okhttp3.HttpUrl#queryParameter(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl#queryParameterName(int)',
|
|
||||||
'okhttp3.HttpUrl#queryParameterNames()',
|
|
||||||
'okhttp3.HttpUrl#queryParameterValue(int)',
|
|
||||||
'okhttp3.HttpUrl#queryParameterValues(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl#querySize()',
|
|
||||||
'okhttp3.HttpUrl#redact()',
|
|
||||||
'okhttp3.HttpUrl#resolve(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl#scheme()',
|
|
||||||
'okhttp3.HttpUrl#topPrivateDomain()',
|
|
||||||
'okhttp3.HttpUrl#uri()',
|
|
||||||
'okhttp3.HttpUrl#url()',
|
|
||||||
'okhttp3.HttpUrl#username()',
|
|
||||||
'okhttp3.HttpUrl$Builder#addEncodedPathSegment(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#addEncodedPathSegments(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#addEncodedQueryParameter(java.lang.String, java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#addPathSegment(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#addPathSegments(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#addQueryParameter(java.lang.String, java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#build()',
|
|
||||||
'okhttp3.HttpUrl$Builder#encodedFragment(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#encodedPassword(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#encodedPath(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#encodedQuery(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#encodedUsername(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#fragment(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#host(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#password(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#port(int)',
|
|
||||||
'okhttp3.HttpUrl$Builder#query(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#removeAllEncodedQueryParameters(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#removeAllQueryParameters(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#removePathSegment(int)',
|
|
||||||
'okhttp3.HttpUrl$Builder#scheme(java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#setEncodedPathSegment(int, java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#setEncodedQueryParameter(java.lang.String, java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#setPathSegment(int, java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#setQueryParameter(java.lang.String, java.lang.String)',
|
|
||||||
'okhttp3.HttpUrl$Builder#username(java.lang.String)',
|
|
||||||
'okhttp3.MediaType#charset()',
|
|
||||||
'okhttp3.MediaType#charset(java.nio.charset.Charset)',
|
|
||||||
'okhttp3.MediaType#subtype()',
|
|
||||||
'okhttp3.MediaType#type()',
|
|
||||||
'okhttp3.MultipartBody#boundary()',
|
|
||||||
'okhttp3.MultipartBody#part(int)',
|
|
||||||
'okhttp3.MultipartBody#parts()',
|
|
||||||
'okhttp3.MultipartBody#size()',
|
|
||||||
'okhttp3.MultipartBody#type()',
|
|
||||||
'okhttp3.MultipartBody$Builder#addFormDataPart(java.lang.String, java.lang.String)',
|
|
||||||
'okhttp3.MultipartBody$Builder#addFormDataPart(java.lang.String, java.lang.String, okhttp3.RequestBody)',
|
|
||||||
'okhttp3.MultipartBody$Builder#addPart(okhttp3.Headers, okhttp3.RequestBody)',
|
|
||||||
'okhttp3.MultipartBody$Builder#addPart(okhttp3.MultipartBody$Part)',
|
|
||||||
'okhttp3.MultipartBody$Builder#addPart(okhttp3.RequestBody)',
|
|
||||||
'okhttp3.MultipartBody$Builder#build()',
|
|
||||||
'okhttp3.MultipartBody$Builder#setType(okhttp3.MediaType)',
|
|
||||||
'okhttp3.MultipartBody$Part#body()',
|
|
||||||
'okhttp3.MultipartBody$Part#headers()',
|
|
||||||
'okhttp3.OkHttpClient$Builder#addInterceptor(okhttp3.Interceptor)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#addNetworkInterceptor(okhttp3.Interceptor)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#authenticator(okhttp3.Authenticator)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#build()',
|
|
||||||
'okhttp3.OkHttpClient$Builder#cache(okhttp3.Cache)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#callTimeout(java.time.Duration)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#callTimeout(long, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#certificatePinner(okhttp3.CertificatePinner)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#connectTimeout(java.time.Duration)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#connectTimeout(long, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#connectionPool(okhttp3.ConnectionPool)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#connectionSpecs(java.util.List)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#cookieJar(okhttp3.CookieJar)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#dispatcher(okhttp3.Dispatcher)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#dns(okhttp3.Dns)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#eventListener(okhttp3.EventListener)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#eventListenerFactory(okhttp3.EventListener$Factory)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#followRedirects(boolean)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#followSslRedirects(boolean)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#hostnameVerifier(javax.net.ssl.HostnameVerifier)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#interceptors()',
|
|
||||||
'okhttp3.OkHttpClient$Builder#networkInterceptors()',
|
|
||||||
'okhttp3.OkHttpClient$Builder#pingInterval(java.time.Duration)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#pingInterval(long, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#protocols(java.util.List)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#proxy(java.net.Proxy)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#proxyAuthenticator(okhttp3.Authenticator)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#proxySelector(java.net.ProxySelector)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#readTimeout(java.time.Duration)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#readTimeout(long, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#retryOnConnectionFailure(boolean)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#socketFactory(javax.net.SocketFactory)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#sslSocketFactory(javax.net.ssl.SSLSocketFactory)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#sslSocketFactory(javax.net.ssl.SSLSocketFactory, javax.net.ssl.X509TrustManager)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#writeTimeout(java.time.Duration)',
|
|
||||||
'okhttp3.OkHttpClient$Builder#writeTimeout(long, java.util.concurrent.TimeUnit)',
|
|
||||||
'okhttp3.RealCall#getResponseWithInterceptorChain()',
|
|
||||||
'okhttp3.RealCall#redactedUrl()',
|
|
||||||
'okhttp3.RealCall#toLoggableString()',
|
|
||||||
'okhttp3.RealCall$AsyncCall#callsPerHost()',
|
|
||||||
'okhttp3.RealCall$AsyncCall#executeOn(java.util.concurrent.ExecutorService)',
|
|
||||||
'okhttp3.RealCall$AsyncCall#get()',
|
|
||||||
'okhttp3.RealCall$AsyncCall#host()',
|
|
||||||
'okhttp3.RealCall$AsyncCall#request()',
|
|
||||||
'okhttp3.RealCall$AsyncCall#reuseCallsPerHostFrom(okhttp3.RealCall$AsyncCall)',
|
|
||||||
'okhttp3.Request#body()',
|
|
||||||
'okhttp3.Request#cacheControl()',
|
|
||||||
'okhttp3.Request#header(java.lang.String)',
|
|
||||||
'okhttp3.Request#headers()',
|
|
||||||
'okhttp3.Request#headers(java.lang.String)',
|
|
||||||
'okhttp3.Request#isHttps()',
|
|
||||||
'okhttp3.Request#method()',
|
|
||||||
'okhttp3.Request#newBuilder()',
|
|
||||||
'okhttp3.Request#tag()',
|
|
||||||
'okhttp3.Request#tag(java.lang.Class)',
|
|
||||||
'okhttp3.Request#url()',
|
|
||||||
'okhttp3.Response#body()',
|
|
||||||
'okhttp3.Response#cacheControl()',
|
|
||||||
'okhttp3.Response#cacheResponse()',
|
|
||||||
'okhttp3.Response#challenges()',
|
|
||||||
'okhttp3.Response#code()',
|
|
||||||
'okhttp3.Response#handshake()',
|
|
||||||
'okhttp3.Response#header(java.lang.String)',
|
|
||||||
'okhttp3.Response#header(java.lang.String, java.lang.String)',
|
|
||||||
'okhttp3.Response#headers()',
|
|
||||||
'okhttp3.Response#headers(java.lang.String)',
|
|
||||||
'okhttp3.Response#isRedirect()',
|
|
||||||
'okhttp3.Response#isSuccessful()',
|
|
||||||
'okhttp3.Response#message()',
|
|
||||||
'okhttp3.Response#networkResponse()',
|
|
||||||
'okhttp3.Response#newBuilder()',
|
|
||||||
'okhttp3.Response#peekBody(long)',
|
|
||||||
'okhttp3.Response#priorResponse()',
|
|
||||||
'okhttp3.Response#protocol()',
|
|
||||||
'okhttp3.Response#receivedResponseAtMillis()',
|
|
||||||
'okhttp3.Response#request()',
|
|
||||||
'okhttp3.Response#sentRequestAtMillis()',
|
|
||||||
'okhttp3.Response#trailers()',
|
|
||||||
'okhttp3.Route#address()',
|
|
||||||
'okhttp3.Route#proxy()',
|
|
||||||
'okhttp3.Route#requiresTunnel()',
|
|
||||||
'okhttp3.Route#socketAddress()',
|
|
||||||
'okhttp3.TlsVersion#javaName()',
|
|
||||||
// Real API change! Became 'final' despite a non-final enclosing class in 4.0.0:
|
|
||||||
'okhttp3.OkHttpClient#authenticator()',
|
'okhttp3.OkHttpClient#authenticator()',
|
||||||
'okhttp3.OkHttpClient#cache()',
|
'okhttp3.OkHttpClient#cache()',
|
||||||
'okhttp3.OkHttpClient#callTimeoutMillis()',
|
'okhttp3.OkHttpClient#callTimeoutMillis()',
|
||||||
|
@ -15,13 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
import okhttp3.internal.toImmutableList
|
|
||||||
import java.net.Proxy
|
import java.net.Proxy
|
||||||
import java.net.ProxySelector
|
import java.net.ProxySelector
|
||||||
import java.util.Objects
|
import java.util.Objects
|
||||||
import javax.net.SocketFactory
|
import javax.net.SocketFactory
|
||||||
import javax.net.ssl.HostnameVerifier
|
import javax.net.ssl.HostnameVerifier
|
||||||
import javax.net.ssl.SSLSocketFactory
|
import javax.net.ssl.SSLSocketFactory
|
||||||
|
import okhttp3.internal.toImmutableList
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A specification for a connection to an origin server. For simple connections, this is the
|
* A specification for a connection to an origin server. For simple connections, this is the
|
||||||
|
@ -15,6 +15,16 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.io.Closeable
|
||||||
|
import java.io.File
|
||||||
|
import java.io.Flushable
|
||||||
|
import java.io.IOException
|
||||||
|
import java.security.cert.Certificate
|
||||||
|
import java.security.cert.CertificateEncodingException
|
||||||
|
import java.security.cert.CertificateException
|
||||||
|
import java.security.cert.CertificateFactory
|
||||||
|
import java.util.NoSuchElementException
|
||||||
|
import java.util.TreeSet
|
||||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||||
import okhttp3.internal.EMPTY_HEADERS
|
import okhttp3.internal.EMPTY_HEADERS
|
||||||
import okhttp3.internal.cache.CacheRequest
|
import okhttp3.internal.cache.CacheRequest
|
||||||
@ -38,16 +48,6 @@ import okio.ForwardingSource
|
|||||||
import okio.Sink
|
import okio.Sink
|
||||||
import okio.Source
|
import okio.Source
|
||||||
import okio.buffer
|
import okio.buffer
|
||||||
import java.io.Closeable
|
|
||||||
import java.io.File
|
|
||||||
import java.io.Flushable
|
|
||||||
import java.io.IOException
|
|
||||||
import java.security.cert.Certificate
|
|
||||||
import java.security.cert.CertificateEncodingException
|
|
||||||
import java.security.cert.CertificateException
|
|
||||||
import java.security.cert.CertificateFactory
|
|
||||||
import java.util.NoSuchElementException
|
|
||||||
import java.util.TreeSet
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Caches HTTP and HTTPS responses to the filesystem so they may be reused, saving time and
|
* Caches HTTP and HTTPS responses to the filesystem so they may be reused, saving time and
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.internal.indexOfNonWhitespace
|
import okhttp3.internal.indexOfNonWhitespace
|
||||||
import okhttp3.internal.toNonNegativeInt
|
import okhttp3.internal.toNonNegativeInt
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Cache-Control header with cache directives from a server or client. These directives set policy
|
* A Cache-Control header with cache directives from a server or client. These directives set policy
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
import okio.Timeout
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
import okio.Timeout
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A call is a request that has been prepared for execution. A call can be canceled. As this object
|
* A call is a request that has been prepared for execution. A call can be canceled. As this object
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.security.cert.Certificate
|
||||||
|
import java.security.cert.X509Certificate
|
||||||
|
import javax.net.ssl.SSLPeerUnverifiedException
|
||||||
import okhttp3.internal.tls.CertificateChainCleaner
|
import okhttp3.internal.tls.CertificateChainCleaner
|
||||||
import okhttp3.internal.toCanonicalHost
|
import okhttp3.internal.toCanonicalHost
|
||||||
import okio.ByteString
|
import okio.ByteString
|
||||||
import okio.ByteString.Companion.decodeBase64
|
import okio.ByteString.Companion.decodeBase64
|
||||||
import okio.ByteString.Companion.toByteString
|
import okio.ByteString.Companion.toByteString
|
||||||
import java.security.cert.Certificate
|
|
||||||
import java.security.cert.X509Certificate
|
|
||||||
import javax.net.ssl.SSLPeerUnverifiedException
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constrains which certificates are trusted. Pinning certificates defends against attacks on
|
* Constrains which certificates are trusted. Pinning certificates defends against attacks on
|
||||||
|
@ -115,4 +115,4 @@ class Challenge(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun toString() = "$scheme authParams=$authParams"
|
override fun toString() = "$scheme authParams=$authParams"
|
||||||
}
|
}
|
||||||
|
@ -16,9 +16,9 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.internal.concurrent.TaskRunner
|
import okhttp3.internal.concurrent.TaskRunner
|
||||||
import okhttp3.internal.connection.RealConnectionPool
|
import okhttp3.internal.connection.RealConnectionPool
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages reuse of HTTP and HTTP/2 connections for reduced network latency. HTTP requests that
|
* Manages reuse of HTTP and HTTP/2 connections for reduced network latency. HTTP requests that
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.util.Arrays
|
||||||
|
import java.util.Objects
|
||||||
|
import javax.net.ssl.SSLSocket
|
||||||
import okhttp3.ConnectionSpec.Builder
|
import okhttp3.ConnectionSpec.Builder
|
||||||
import okhttp3.internal.concat
|
import okhttp3.internal.concat
|
||||||
import okhttp3.internal.hasIntersection
|
import okhttp3.internal.hasIntersection
|
||||||
import okhttp3.internal.indexOf
|
import okhttp3.internal.indexOf
|
||||||
import okhttp3.internal.intersect
|
import okhttp3.internal.intersect
|
||||||
import java.util.Arrays
|
|
||||||
import java.util.Objects
|
|
||||||
import javax.net.ssl.SSLSocket
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies configuration for the socket connection that HTTP traffic travels through. For `https:`
|
* Specifies configuration for the socket connection that HTTP traffic travels through. For `https:`
|
||||||
|
@ -15,6 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.util.Calendar
|
||||||
|
import java.util.Collections
|
||||||
|
import java.util.Date
|
||||||
|
import java.util.GregorianCalendar
|
||||||
|
import java.util.Locale
|
||||||
|
import java.util.regex.Pattern
|
||||||
import okhttp3.internal.UTC
|
import okhttp3.internal.UTC
|
||||||
import okhttp3.internal.canParseAsIpAddress
|
import okhttp3.internal.canParseAsIpAddress
|
||||||
import okhttp3.internal.delimiterOffset
|
import okhttp3.internal.delimiterOffset
|
||||||
@ -25,12 +31,6 @@ import okhttp3.internal.publicsuffix.PublicSuffixDatabase
|
|||||||
import okhttp3.internal.toCanonicalHost
|
import okhttp3.internal.toCanonicalHost
|
||||||
import okhttp3.internal.trimSubstring
|
import okhttp3.internal.trimSubstring
|
||||||
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
||||||
import java.util.Calendar
|
|
||||||
import java.util.Collections
|
|
||||||
import java.util.Date
|
|
||||||
import java.util.GregorianCalendar
|
|
||||||
import java.util.Locale
|
|
||||||
import java.util.regex.Pattern
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An [RFC 6265](http://tools.ietf.org/html/rfc6265) Cookie.
|
* An [RFC 6265](http://tools.ietf.org/html/rfc6265) Cookie.
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
import okio.ByteString.Companion.encode
|
|
||||||
import java.nio.charset.Charset
|
import java.nio.charset.Charset
|
||||||
import java.nio.charset.StandardCharsets.ISO_8859_1
|
import java.nio.charset.StandardCharsets.ISO_8859_1
|
||||||
|
import okio.ByteString.Companion.encode
|
||||||
|
|
||||||
/** Factory for HTTP authorization credentials. */
|
/** Factory for HTTP authorization credentials. */
|
||||||
object Credentials {
|
object Credentials {
|
||||||
|
@ -15,9 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
import okhttp3.RealCall.AsyncCall
|
|
||||||
import okhttp3.internal.assertThreadDoesntHoldLock
|
|
||||||
import okhttp3.internal.threadFactory
|
|
||||||
import java.util.ArrayDeque
|
import java.util.ArrayDeque
|
||||||
import java.util.Collections
|
import java.util.Collections
|
||||||
import java.util.Deque
|
import java.util.Deque
|
||||||
@ -25,6 +22,9 @@ import java.util.concurrent.ExecutorService
|
|||||||
import java.util.concurrent.SynchronousQueue
|
import java.util.concurrent.SynchronousQueue
|
||||||
import java.util.concurrent.ThreadPoolExecutor
|
import java.util.concurrent.ThreadPoolExecutor
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
import okhttp3.RealCall.AsyncCall
|
||||||
|
import okhttp3.internal.assertThreadDoesntHoldLock
|
||||||
|
import okhttp3.internal.threadFactory
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Policy on when async requests are executed.
|
* Policy on when async requests are executed.
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
import okhttp3.Dns.Companion.SYSTEM
|
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
import java.net.UnknownHostException
|
import java.net.UnknownHostException
|
||||||
|
import okhttp3.Dns.Companion.SYSTEM
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A domain name service that resolves IP addresses for host names. Most applications will use the
|
* A domain name service that resolves IP addresses for host names. Most applications will use the
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.nio.charset.Charset
|
||||||
import okhttp3.HttpUrl.Companion.FORM_ENCODE_SET
|
import okhttp3.HttpUrl.Companion.FORM_ENCODE_SET
|
||||||
import okhttp3.HttpUrl.Companion.canonicalize
|
import okhttp3.HttpUrl.Companion.canonicalize
|
||||||
import okhttp3.HttpUrl.Companion.percentDecode
|
import okhttp3.HttpUrl.Companion.percentDecode
|
||||||
@ -22,8 +24,6 @@ import okhttp3.MediaType.Companion.toMediaType
|
|||||||
import okhttp3.internal.toImmutableList
|
import okhttp3.internal.toImmutableList
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
import okio.BufferedSink
|
import okio.BufferedSink
|
||||||
import java.io.IOException
|
|
||||||
import java.nio.charset.Charset
|
|
||||||
|
|
||||||
class FormBody internal constructor(
|
class FormBody internal constructor(
|
||||||
encodedNames: List<String>,
|
encodedNames: List<String>,
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
import okhttp3.internal.immutableListOf
|
|
||||||
import okhttp3.internal.toImmutableList
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.security.Principal
|
import java.security.Principal
|
||||||
import java.security.cert.Certificate
|
import java.security.cert.Certificate
|
||||||
import java.security.cert.X509Certificate
|
import java.security.cert.X509Certificate
|
||||||
import javax.net.ssl.SSLPeerUnverifiedException
|
import javax.net.ssl.SSLPeerUnverifiedException
|
||||||
import javax.net.ssl.SSLSession
|
import javax.net.ssl.SSLSession
|
||||||
|
import okhttp3.internal.immutableListOf
|
||||||
|
import okhttp3.internal.toImmutableList
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A record of a TLS handshake. For HTTPS clients, the client is *local* and the remote server is
|
* A record of a TLS handshake. For HTTPS clients, the client is *local* and the remote server is
|
||||||
|
@ -17,11 +17,6 @@
|
|||||||
|
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
import okhttp3.Headers.Builder
|
|
||||||
import okhttp3.internal.format
|
|
||||||
import okhttp3.internal.http.toHttpDateOrNull
|
|
||||||
import okhttp3.internal.http.toHttpDateString
|
|
||||||
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
import java.util.Collections
|
import java.util.Collections
|
||||||
@ -29,6 +24,11 @@ import java.util.Date
|
|||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import java.util.TreeMap
|
import java.util.TreeMap
|
||||||
import java.util.TreeSet
|
import java.util.TreeSet
|
||||||
|
import okhttp3.Headers.Builder
|
||||||
|
import okhttp3.internal.format
|
||||||
|
import okhttp3.internal.http.toHttpDateOrNull
|
||||||
|
import okhttp3.internal.http.toHttpDateString
|
||||||
|
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The header fields of a single HTTP message. Values are uninterpreted strings; use `Request` and
|
* The header fields of a single HTTP message. Values are uninterpreted strings; use `Request` and
|
||||||
|
@ -15,16 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
|
||||||
import okhttp3.internal.canParseAsIpAddress
|
|
||||||
import okhttp3.internal.delimiterOffset
|
|
||||||
import okhttp3.internal.indexOfFirstNonAsciiWhitespace
|
|
||||||
import okhttp3.internal.indexOfLastNonAsciiWhitespace
|
|
||||||
import okhttp3.internal.parseHexDigit
|
|
||||||
import okhttp3.internal.publicsuffix.PublicSuffixDatabase
|
|
||||||
import okhttp3.internal.toCanonicalHost
|
|
||||||
import okio.Buffer
|
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
import java.net.MalformedURLException
|
import java.net.MalformedURLException
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
@ -35,6 +25,16 @@ import java.nio.charset.StandardCharsets.UTF_8
|
|||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
import java.util.Collections
|
import java.util.Collections
|
||||||
import java.util.LinkedHashSet
|
import java.util.LinkedHashSet
|
||||||
|
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||||
|
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||||
|
import okhttp3.internal.canParseAsIpAddress
|
||||||
|
import okhttp3.internal.delimiterOffset
|
||||||
|
import okhttp3.internal.indexOfFirstNonAsciiWhitespace
|
||||||
|
import okhttp3.internal.indexOfLastNonAsciiWhitespace
|
||||||
|
import okhttp3.internal.parseHexDigit
|
||||||
|
import okhttp3.internal.publicsuffix.PublicSuffixDatabase
|
||||||
|
import okhttp3.internal.toCanonicalHost
|
||||||
|
import okio.Buffer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A uniform resource locator (URL) with a scheme of either `http` or `https`. Use this class to
|
* A uniform resource locator (URL) with a scheme of either `http` or `https`. Use this class to
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.util.UUID
|
||||||
import okhttp3.MediaType.Companion.toMediaType
|
import okhttp3.MediaType.Companion.toMediaType
|
||||||
import okhttp3.internal.toImmutableList
|
import okhttp3.internal.toImmutableList
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
import okio.BufferedSink
|
import okio.BufferedSink
|
||||||
import okio.ByteString
|
import okio.ByteString
|
||||||
import okio.ByteString.Companion.encodeUtf8
|
import okio.ByteString.Companion.encodeUtf8
|
||||||
import java.io.IOException
|
|
||||||
import java.util.UUID
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An [RFC 2387][rfc_2387]-compliant request body.
|
* An [RFC 2387][rfc_2387]-compliant request body.
|
||||||
|
@ -15,6 +15,20 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.net.Proxy
|
||||||
|
import java.net.ProxySelector
|
||||||
|
import java.net.Socket
|
||||||
|
import java.security.GeneralSecurityException
|
||||||
|
import java.time.Duration
|
||||||
|
import java.util.Collections
|
||||||
|
import java.util.Random
|
||||||
|
import java.util.concurrent.ExecutorService
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
import javax.net.SocketFactory
|
||||||
|
import javax.net.ssl.HostnameVerifier
|
||||||
|
import javax.net.ssl.SSLSocketFactory
|
||||||
|
import javax.net.ssl.TrustManager
|
||||||
|
import javax.net.ssl.X509TrustManager
|
||||||
import okhttp3.Protocol.HTTP_1_1
|
import okhttp3.Protocol.HTTP_1_1
|
||||||
import okhttp3.Protocol.HTTP_2
|
import okhttp3.Protocol.HTTP_2
|
||||||
import okhttp3.internal.asFactory
|
import okhttp3.internal.asFactory
|
||||||
@ -30,20 +44,6 @@ import okhttp3.internal.ws.RealWebSocket
|
|||||||
import okio.Sink
|
import okio.Sink
|
||||||
import okio.Source
|
import okio.Source
|
||||||
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
||||||
import java.net.Proxy
|
|
||||||
import java.net.ProxySelector
|
|
||||||
import java.net.Socket
|
|
||||||
import java.security.GeneralSecurityException
|
|
||||||
import java.time.Duration
|
|
||||||
import java.util.Collections
|
|
||||||
import java.util.Random
|
|
||||||
import java.util.concurrent.ExecutorService
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
import javax.net.SocketFactory
|
|
||||||
import javax.net.ssl.HostnameVerifier
|
|
||||||
import javax.net.ssl.SSLSocketFactory
|
|
||||||
import javax.net.ssl.TrustManager
|
|
||||||
import javax.net.ssl.X509TrustManager
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory for [calls][Call], which can be used to send HTTP requests and read their responses.
|
* Factory for [calls][Call], which can be used to send HTTP requests and read their responses.
|
||||||
|
@ -15,6 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.io.InterruptedIOException
|
||||||
|
import java.util.concurrent.ExecutorService
|
||||||
|
import java.util.concurrent.RejectedExecutionException
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger
|
||||||
import okhttp3.internal.assertThreadDoesntHoldLock
|
import okhttp3.internal.assertThreadDoesntHoldLock
|
||||||
import okhttp3.internal.cache.CacheInterceptor
|
import okhttp3.internal.cache.CacheInterceptor
|
||||||
import okhttp3.internal.closeQuietly
|
import okhttp3.internal.closeQuietly
|
||||||
@ -28,11 +33,6 @@ import okhttp3.internal.platform.Platform
|
|||||||
import okhttp3.internal.platform.Platform.Companion.INFO
|
import okhttp3.internal.platform.Platform.Companion.INFO
|
||||||
import okhttp3.internal.threadName
|
import okhttp3.internal.threadName
|
||||||
import okio.Timeout
|
import okio.Timeout
|
||||||
import java.io.IOException
|
|
||||||
import java.io.InterruptedIOException
|
|
||||||
import java.util.concurrent.ExecutorService
|
|
||||||
import java.util.concurrent.RejectedExecutionException
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger
|
|
||||||
|
|
||||||
internal class RealCall private constructor(
|
internal class RealCall private constructor(
|
||||||
val client: OkHttpClient,
|
val client: OkHttpClient,
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.net.URL
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||||
import okhttp3.internal.EMPTY_REQUEST
|
import okhttp3.internal.EMPTY_REQUEST
|
||||||
import okhttp3.internal.http.HttpMethod
|
import okhttp3.internal.http.HttpMethod
|
||||||
import okhttp3.internal.toImmutableMap
|
import okhttp3.internal.toImmutableMap
|
||||||
import java.net.URL
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An HTTP request. Instances of this class are immutable if their [body] is null or itself
|
* An HTTP request. Instances of this class are immutable if their [body] is null or itself
|
||||||
|
@ -15,15 +15,15 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
|
import java.io.File
|
||||||
|
import java.io.IOException
|
||||||
|
import java.nio.charset.Charset
|
||||||
|
import kotlin.text.Charsets.UTF_8
|
||||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||||
import okhttp3.internal.checkOffsetAndCount
|
import okhttp3.internal.checkOffsetAndCount
|
||||||
import okio.BufferedSink
|
import okio.BufferedSink
|
||||||
import okio.ByteString
|
import okio.ByteString
|
||||||
import okio.source
|
import okio.source
|
||||||
import java.io.File
|
|
||||||
import java.io.IOException
|
|
||||||
import java.nio.charset.Charset
|
|
||||||
import kotlin.text.Charsets.UTF_8
|
|
||||||
|
|
||||||
abstract class RequestBody {
|
abstract class RequestBody {
|
||||||
|
|
||||||
|
@ -15,12 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
import okhttp3.ResponseBody.Companion.asResponseBody
|
|
||||||
import okhttp3.internal.connection.Exchange
|
|
||||||
import okhttp3.internal.http.StatusLine.Companion.HTTP_PERM_REDIRECT
|
|
||||||
import okhttp3.internal.http.StatusLine.Companion.HTTP_TEMP_REDIRECT
|
|
||||||
import okhttp3.internal.http.parseChallenges
|
|
||||||
import okio.Buffer
|
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.net.HttpURLConnection.HTTP_MOVED_PERM
|
import java.net.HttpURLConnection.HTTP_MOVED_PERM
|
||||||
@ -29,6 +23,12 @@ import java.net.HttpURLConnection.HTTP_MULT_CHOICE
|
|||||||
import java.net.HttpURLConnection.HTTP_PROXY_AUTH
|
import java.net.HttpURLConnection.HTTP_PROXY_AUTH
|
||||||
import java.net.HttpURLConnection.HTTP_SEE_OTHER
|
import java.net.HttpURLConnection.HTTP_SEE_OTHER
|
||||||
import java.net.HttpURLConnection.HTTP_UNAUTHORIZED
|
import java.net.HttpURLConnection.HTTP_UNAUTHORIZED
|
||||||
|
import okhttp3.ResponseBody.Companion.asResponseBody
|
||||||
|
import okhttp3.internal.connection.Exchange
|
||||||
|
import okhttp3.internal.http.StatusLine.Companion.HTTP_PERM_REDIRECT
|
||||||
|
import okhttp3.internal.http.StatusLine.Companion.HTTP_TEMP_REDIRECT
|
||||||
|
import okhttp3.internal.http.parseChallenges
|
||||||
|
import okio.Buffer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An HTTP response. Instances of this class are not immutable: the response body is a one-shot
|
* An HTTP response. Instances of this class are not immutable: the response body is a one-shot
|
||||||
|
@ -15,12 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3
|
package okhttp3
|
||||||
|
|
||||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
|
||||||
import okhttp3.internal.closeQuietly
|
|
||||||
import okhttp3.internal.readBomAsCharset
|
|
||||||
import okio.Buffer
|
|
||||||
import okio.BufferedSource
|
|
||||||
import okio.ByteString
|
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
@ -28,6 +22,12 @@ import java.io.InputStreamReader
|
|||||||
import java.io.Reader
|
import java.io.Reader
|
||||||
import java.nio.charset.Charset
|
import java.nio.charset.Charset
|
||||||
import kotlin.text.Charsets.UTF_8
|
import kotlin.text.Charsets.UTF_8
|
||||||
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||||
|
import okhttp3.internal.closeQuietly
|
||||||
|
import okhttp3.internal.readBomAsCharset
|
||||||
|
import okio.Buffer
|
||||||
|
import okio.BufferedSource
|
||||||
|
import okio.ByteString
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A one-shot stream from the origin server to the client application with the raw bytes of the
|
* A one-shot stream from the origin server to the client application with the raw bytes of the
|
||||||
|
@ -17,22 +17,6 @@
|
|||||||
|
|
||||||
package okhttp3.internal
|
package okhttp3.internal
|
||||||
|
|
||||||
import okhttp3.Call
|
|
||||||
import okhttp3.EventListener
|
|
||||||
import okhttp3.Headers
|
|
||||||
import okhttp3.Headers.Companion.headersOf
|
|
||||||
import okhttp3.HttpUrl
|
|
||||||
import okhttp3.OkHttpClient
|
|
||||||
import okhttp3.RequestBody.Companion.toRequestBody
|
|
||||||
import okhttp3.Response
|
|
||||||
import okhttp3.ResponseBody.Companion.toResponseBody
|
|
||||||
import okhttp3.internal.http2.Header
|
|
||||||
import okio.Buffer
|
|
||||||
import okio.BufferedSink
|
|
||||||
import okio.BufferedSource
|
|
||||||
import okio.ByteString.Companion.decodeHex
|
|
||||||
import okio.Options
|
|
||||||
import okio.Source
|
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InterruptedIOException
|
import java.io.InterruptedIOException
|
||||||
@ -53,6 +37,22 @@ import java.util.concurrent.ThreadFactory
|
|||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import kotlin.text.Charsets.UTF_32BE
|
import kotlin.text.Charsets.UTF_32BE
|
||||||
import kotlin.text.Charsets.UTF_32LE
|
import kotlin.text.Charsets.UTF_32LE
|
||||||
|
import okhttp3.Call
|
||||||
|
import okhttp3.EventListener
|
||||||
|
import okhttp3.Headers
|
||||||
|
import okhttp3.Headers.Companion.headersOf
|
||||||
|
import okhttp3.HttpUrl
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.RequestBody.Companion.toRequestBody
|
||||||
|
import okhttp3.Response
|
||||||
|
import okhttp3.ResponseBody.Companion.toResponseBody
|
||||||
|
import okhttp3.internal.http2.Header
|
||||||
|
import okio.Buffer
|
||||||
|
import okio.BufferedSink
|
||||||
|
import okio.BufferedSource
|
||||||
|
import okio.ByteString.Companion.decodeHex
|
||||||
|
import okio.Options
|
||||||
|
import okio.Source
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
val EMPTY_BYTE_ARRAY = ByteArray(0)
|
val EMPTY_BYTE_ARRAY = ByteArray(0)
|
||||||
|
@ -16,6 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.cache
|
package okhttp3.internal.cache
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.HttpURLConnection.HTTP_GATEWAY_TIMEOUT
|
||||||
|
import java.net.HttpURLConnection.HTTP_NOT_MODIFIED
|
||||||
|
import java.util.concurrent.TimeUnit.MILLISECONDS
|
||||||
import okhttp3.Cache
|
import okhttp3.Cache
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
@ -32,10 +36,6 @@ import okio.Buffer
|
|||||||
import okio.Source
|
import okio.Source
|
||||||
import okio.Timeout
|
import okio.Timeout
|
||||||
import okio.buffer
|
import okio.buffer
|
||||||
import java.io.IOException
|
|
||||||
import java.net.HttpURLConnection.HTTP_GATEWAY_TIMEOUT
|
|
||||||
import java.net.HttpURLConnection.HTTP_NOT_MODIFIED
|
|
||||||
import java.util.concurrent.TimeUnit.MILLISECONDS
|
|
||||||
|
|
||||||
/** Serves requests from the cache and writes responses to the cache. */
|
/** Serves requests from the cache and writes responses to the cache. */
|
||||||
class CacheInterceptor(internal val cache: Cache?) : Interceptor {
|
class CacheInterceptor(internal val cache: Cache?) : Interceptor {
|
||||||
|
@ -15,11 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.cache
|
package okhttp3.internal.cache
|
||||||
|
|
||||||
import okhttp3.Request
|
|
||||||
import okhttp3.Response
|
|
||||||
import okhttp3.internal.http.StatusLine
|
|
||||||
import okhttp3.internal.http.toHttpDateOrNull
|
|
||||||
import okhttp3.internal.toNonNegativeInt
|
|
||||||
import java.net.HttpURLConnection.HTTP_BAD_METHOD
|
import java.net.HttpURLConnection.HTTP_BAD_METHOD
|
||||||
import java.net.HttpURLConnection.HTTP_GONE
|
import java.net.HttpURLConnection.HTTP_GONE
|
||||||
import java.net.HttpURLConnection.HTTP_MOVED_PERM
|
import java.net.HttpURLConnection.HTTP_MOVED_PERM
|
||||||
@ -33,6 +28,11 @@ import java.net.HttpURLConnection.HTTP_OK
|
|||||||
import java.net.HttpURLConnection.HTTP_REQ_TOO_LONG
|
import java.net.HttpURLConnection.HTTP_REQ_TOO_LONG
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.concurrent.TimeUnit.SECONDS
|
import java.util.concurrent.TimeUnit.SECONDS
|
||||||
|
import okhttp3.Request
|
||||||
|
import okhttp3.Response
|
||||||
|
import okhttp3.internal.http.StatusLine
|
||||||
|
import okhttp3.internal.http.toHttpDateOrNull
|
||||||
|
import okhttp3.internal.toNonNegativeInt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a request and cached response, this figures out whether to use the network, the cache, or
|
* Given a request and cached response, this figures out whether to use the network, the cache, or
|
||||||
|
@ -15,6 +15,15 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.cache
|
package okhttp3.internal.cache
|
||||||
|
|
||||||
|
import java.io.Closeable
|
||||||
|
import java.io.EOFException
|
||||||
|
import java.io.File
|
||||||
|
import java.io.FileNotFoundException
|
||||||
|
import java.io.Flushable
|
||||||
|
import java.io.IOException
|
||||||
|
import java.util.ArrayList
|
||||||
|
import java.util.LinkedHashMap
|
||||||
|
import java.util.NoSuchElementException
|
||||||
import okhttp3.internal.assertThreadHoldsLock
|
import okhttp3.internal.assertThreadHoldsLock
|
||||||
import okhttp3.internal.cache.DiskLruCache.Editor
|
import okhttp3.internal.cache.DiskLruCache.Editor
|
||||||
import okhttp3.internal.closeQuietly
|
import okhttp3.internal.closeQuietly
|
||||||
@ -28,15 +37,6 @@ import okio.Sink
|
|||||||
import okio.Source
|
import okio.Source
|
||||||
import okio.blackholeSink
|
import okio.blackholeSink
|
||||||
import okio.buffer
|
import okio.buffer
|
||||||
import java.io.Closeable
|
|
||||||
import java.io.EOFException
|
|
||||||
import java.io.File
|
|
||||||
import java.io.FileNotFoundException
|
|
||||||
import java.io.Flushable
|
|
||||||
import java.io.IOException
|
|
||||||
import java.util.ArrayList
|
|
||||||
import java.util.LinkedHashMap
|
|
||||||
import java.util.NoSuchElementException
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A cache that uses a bounded amount of space on a filesystem. Each cache entry has a string key
|
* A cache that uses a bounded amount of space on a filesystem. Each cache entry has a string key
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.cache
|
package okhttp3.internal.cache
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
import okio.ForwardingSink
|
import okio.ForwardingSink
|
||||||
import okio.Sink
|
import okio.Sink
|
||||||
import java.io.IOException
|
|
||||||
|
|
||||||
/** A sink that never throws IOExceptions, even if the underlying sink does. */
|
/** A sink that never throws IOExceptions, even if the underlying sink does. */
|
||||||
internal open class FaultHidingSink(
|
internal open class FaultHidingSink(
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.cache2
|
package okhttp3.internal.cache2
|
||||||
|
|
||||||
import okio.Buffer
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.nio.channels.FileChannel
|
import java.nio.channels.FileChannel
|
||||||
|
import okio.Buffer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read and write a target file. Unlike Okio's built-in `Okio.source(java.io.File file)` and `Okio.sink(java.io.File file)`
|
* Read and write a target file. Unlike Okio's built-in `Okio.source(java.io.File file)` and `Okio.sink(java.io.File file)`
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.cache2
|
package okhttp3.internal.cache2
|
||||||
|
|
||||||
|
import java.io.File
|
||||||
|
import java.io.IOException
|
||||||
|
import java.io.RandomAccessFile
|
||||||
import okhttp3.internal.closeQuietly
|
import okhttp3.internal.closeQuietly
|
||||||
import okhttp3.internal.notifyAll
|
import okhttp3.internal.notifyAll
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
@ -22,9 +25,6 @@ import okio.ByteString
|
|||||||
import okio.ByteString.Companion.encodeUtf8
|
import okio.ByteString.Companion.encodeUtf8
|
||||||
import okio.Source
|
import okio.Source
|
||||||
import okio.Timeout
|
import okio.Timeout
|
||||||
import java.io.File
|
|
||||||
import java.io.IOException
|
|
||||||
import java.io.RandomAccessFile
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replicates a single upstream source into multiple downstream sources. Each downstream source
|
* Replicates a single upstream source into multiple downstream sources. Each downstream source
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.concurrent
|
package okhttp3.internal.concurrent
|
||||||
|
|
||||||
import okhttp3.internal.assertThreadDoesntHoldLock
|
|
||||||
import java.util.concurrent.CountDownLatch
|
import java.util.concurrent.CountDownLatch
|
||||||
import java.util.concurrent.RejectedExecutionException
|
import java.util.concurrent.RejectedExecutionException
|
||||||
|
import okhttp3.internal.assertThreadDoesntHoldLock
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A set of tasks that are executed in sequential order.
|
* A set of tasks that are executed in sequential order.
|
||||||
|
@ -15,17 +15,17 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.concurrent
|
package okhttp3.internal.concurrent
|
||||||
|
|
||||||
|
import java.util.concurrent.SynchronousQueue
|
||||||
|
import java.util.concurrent.ThreadFactory
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
import java.util.logging.Logger
|
||||||
import okhttp3.internal.addIfAbsent
|
import okhttp3.internal.addIfAbsent
|
||||||
import okhttp3.internal.assertThreadDoesntHoldLock
|
import okhttp3.internal.assertThreadDoesntHoldLock
|
||||||
import okhttp3.internal.assertThreadHoldsLock
|
import okhttp3.internal.assertThreadHoldsLock
|
||||||
import okhttp3.internal.concurrent.TaskRunner.Companion.INSTANCE
|
import okhttp3.internal.concurrent.TaskRunner.Companion.INSTANCE
|
||||||
import okhttp3.internal.notify
|
import okhttp3.internal.notify
|
||||||
import okhttp3.internal.threadFactory
|
import okhttp3.internal.threadFactory
|
||||||
import java.util.concurrent.SynchronousQueue
|
|
||||||
import java.util.concurrent.ThreadFactory
|
|
||||||
import java.util.concurrent.ThreadPoolExecutor
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
import java.util.logging.Logger
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A set of worker threads that are shared among a set of task queues.
|
* A set of worker threads that are shared among a set of task queues.
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.connection
|
package okhttp3.internal.connection
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import okhttp3.internal.http.RealInterceptorChain
|
import okhttp3.internal.http.RealInterceptorChain
|
||||||
import java.io.IOException
|
|
||||||
|
|
||||||
/** Opens a connection to the target server and proceeds to the next interceptor. */
|
/** Opens a connection to the target server and proceeds to the next interceptor. */
|
||||||
object ConnectInterceptor : Interceptor {
|
object ConnectInterceptor : Interceptor {
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.connection
|
package okhttp3.internal.connection
|
||||||
|
|
||||||
import okhttp3.ConnectionSpec
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InterruptedIOException
|
import java.io.InterruptedIOException
|
||||||
import java.net.ProtocolException
|
import java.net.ProtocolException
|
||||||
@ -25,6 +24,7 @@ import javax.net.ssl.SSLException
|
|||||||
import javax.net.ssl.SSLHandshakeException
|
import javax.net.ssl.SSLHandshakeException
|
||||||
import javax.net.ssl.SSLPeerUnverifiedException
|
import javax.net.ssl.SSLPeerUnverifiedException
|
||||||
import javax.net.ssl.SSLSocket
|
import javax.net.ssl.SSLSocket
|
||||||
|
import okhttp3.ConnectionSpec
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the connection spec fallback strategy: When a secure socket connection fails due to a
|
* Handles the connection spec fallback strategy: When a secure socket connection fails due to a
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.connection
|
package okhttp3.internal.connection
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.ProtocolException
|
||||||
|
import java.net.SocketException
|
||||||
import okhttp3.Call
|
import okhttp3.Call
|
||||||
import okhttp3.EventListener
|
import okhttp3.EventListener
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
@ -30,9 +33,6 @@ import okio.ForwardingSource
|
|||||||
import okio.Sink
|
import okio.Sink
|
||||||
import okio.Source
|
import okio.Source
|
||||||
import okio.buffer
|
import okio.buffer
|
||||||
import java.io.IOException
|
|
||||||
import java.net.ProtocolException
|
|
||||||
import java.net.SocketException
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transmits a single HTTP request and a response pair. This layers connection management and events
|
* Transmits a single HTTP request and a response pair. This layers connection management and events
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.connection
|
package okhttp3.internal.connection
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.Socket
|
||||||
import okhttp3.Address
|
import okhttp3.Address
|
||||||
import okhttp3.Call
|
import okhttp3.Call
|
||||||
import okhttp3.EventListener
|
import okhttp3.EventListener
|
||||||
@ -26,8 +28,6 @@ import okhttp3.internal.assertThreadHoldsLock
|
|||||||
import okhttp3.internal.canReuseConnectionFor
|
import okhttp3.internal.canReuseConnectionFor
|
||||||
import okhttp3.internal.closeQuietly
|
import okhttp3.internal.closeQuietly
|
||||||
import okhttp3.internal.http.ExchangeCodec
|
import okhttp3.internal.http.ExchangeCodec
|
||||||
import java.io.IOException
|
|
||||||
import java.net.Socket
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to find the connections for a sequence of exchanges. This uses the following strategies:
|
* Attempts to find the connections for a sequence of exchanges. This uses the following strategies:
|
||||||
|
@ -16,6 +16,21 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.connection
|
package okhttp3.internal.connection
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.lang.ref.Reference
|
||||||
|
import java.net.ConnectException
|
||||||
|
import java.net.HttpURLConnection.HTTP_OK
|
||||||
|
import java.net.HttpURLConnection.HTTP_PROXY_AUTH
|
||||||
|
import java.net.ProtocolException
|
||||||
|
import java.net.Proxy
|
||||||
|
import java.net.Socket
|
||||||
|
import java.net.SocketException
|
||||||
|
import java.net.SocketTimeoutException
|
||||||
|
import java.net.UnknownServiceException
|
||||||
|
import java.security.cert.X509Certificate
|
||||||
|
import java.util.concurrent.TimeUnit.MILLISECONDS
|
||||||
|
import javax.net.ssl.SSLPeerUnverifiedException
|
||||||
|
import javax.net.ssl.SSLSocket
|
||||||
import okhttp3.Address
|
import okhttp3.Address
|
||||||
import okhttp3.Call
|
import okhttp3.Call
|
||||||
import okhttp3.CertificatePinner
|
import okhttp3.CertificatePinner
|
||||||
@ -54,21 +69,6 @@ import okio.BufferedSource
|
|||||||
import okio.buffer
|
import okio.buffer
|
||||||
import okio.sink
|
import okio.sink
|
||||||
import okio.source
|
import okio.source
|
||||||
import java.io.IOException
|
|
||||||
import java.lang.ref.Reference
|
|
||||||
import java.net.ConnectException
|
|
||||||
import java.net.HttpURLConnection.HTTP_OK
|
|
||||||
import java.net.HttpURLConnection.HTTP_PROXY_AUTH
|
|
||||||
import java.net.ProtocolException
|
|
||||||
import java.net.Proxy
|
|
||||||
import java.net.Socket
|
|
||||||
import java.net.SocketException
|
|
||||||
import java.net.SocketTimeoutException
|
|
||||||
import java.net.UnknownServiceException
|
|
||||||
import java.security.cert.X509Certificate
|
|
||||||
import java.util.concurrent.TimeUnit.MILLISECONDS
|
|
||||||
import javax.net.ssl.SSLPeerUnverifiedException
|
|
||||||
import javax.net.ssl.SSLSocket
|
|
||||||
|
|
||||||
class RealConnection(
|
class RealConnection(
|
||||||
val connectionPool: RealConnectionPool,
|
val connectionPool: RealConnectionPool,
|
||||||
|
@ -16,6 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.connection
|
package okhttp3.internal.connection
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.Proxy
|
||||||
|
import java.util.ArrayDeque
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.Address
|
import okhttp3.Address
|
||||||
import okhttp3.ConnectionPool
|
import okhttp3.ConnectionPool
|
||||||
import okhttp3.Route
|
import okhttp3.Route
|
||||||
@ -26,10 +30,6 @@ import okhttp3.internal.concurrent.TaskQueue
|
|||||||
import okhttp3.internal.concurrent.TaskRunner
|
import okhttp3.internal.concurrent.TaskRunner
|
||||||
import okhttp3.internal.connection.Transmitter.TransmitterReference
|
import okhttp3.internal.connection.Transmitter.TransmitterReference
|
||||||
import okhttp3.internal.platform.Platform
|
import okhttp3.internal.platform.Platform
|
||||||
import java.io.IOException
|
|
||||||
import java.net.Proxy
|
|
||||||
import java.util.ArrayDeque
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
class RealConnectionPool(
|
class RealConnectionPool(
|
||||||
taskRunner: TaskRunner,
|
taskRunner: TaskRunner,
|
||||||
|
@ -15,6 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.connection
|
package okhttp3.internal.connection
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.InetSocketAddress
|
||||||
|
import java.net.Proxy
|
||||||
|
import java.net.SocketException
|
||||||
|
import java.net.UnknownHostException
|
||||||
|
import java.util.NoSuchElementException
|
||||||
import okhttp3.Address
|
import okhttp3.Address
|
||||||
import okhttp3.Call
|
import okhttp3.Call
|
||||||
import okhttp3.EventListener
|
import okhttp3.EventListener
|
||||||
@ -22,12 +28,6 @@ import okhttp3.HttpUrl
|
|||||||
import okhttp3.Route
|
import okhttp3.Route
|
||||||
import okhttp3.internal.immutableListOf
|
import okhttp3.internal.immutableListOf
|
||||||
import okhttp3.internal.toImmutableList
|
import okhttp3.internal.toImmutableList
|
||||||
import java.io.IOException
|
|
||||||
import java.net.InetSocketAddress
|
|
||||||
import java.net.Proxy
|
|
||||||
import java.net.SocketException
|
|
||||||
import java.net.UnknownHostException
|
|
||||||
import java.util.NoSuchElementException
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Selects routes to connect to an origin server. Each connection requires a choice of proxy server,
|
* Selects routes to connect to an origin server. Each connection requires a choice of proxy server,
|
||||||
|
@ -15,6 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.connection
|
package okhttp3.internal.connection
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.io.InterruptedIOException
|
||||||
|
import java.lang.ref.WeakReference
|
||||||
|
import java.net.Socket
|
||||||
|
import java.util.concurrent.TimeUnit.MILLISECONDS
|
||||||
|
import javax.net.ssl.HostnameVerifier
|
||||||
|
import javax.net.ssl.SSLSocketFactory
|
||||||
import okhttp3.Address
|
import okhttp3.Address
|
||||||
import okhttp3.Call
|
import okhttp3.Call
|
||||||
import okhttp3.CertificatePinner
|
import okhttp3.CertificatePinner
|
||||||
@ -25,18 +32,11 @@ import okhttp3.Interceptor
|
|||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import okhttp3.internal.assertThreadHoldsLock
|
import okhttp3.internal.assertThreadHoldsLock
|
||||||
import okhttp3.internal.closeQuietly
|
|
||||||
import okhttp3.internal.canReuseConnectionFor
|
import okhttp3.internal.canReuseConnectionFor
|
||||||
|
import okhttp3.internal.closeQuietly
|
||||||
import okhttp3.internal.platform.Platform
|
import okhttp3.internal.platform.Platform
|
||||||
import okio.AsyncTimeout
|
import okio.AsyncTimeout
|
||||||
import okio.Timeout
|
import okio.Timeout
|
||||||
import java.io.IOException
|
|
||||||
import java.io.InterruptedIOException
|
|
||||||
import java.lang.ref.WeakReference
|
|
||||||
import java.net.Socket
|
|
||||||
import java.util.concurrent.TimeUnit.MILLISECONDS
|
|
||||||
import javax.net.ssl.HostnameVerifier
|
|
||||||
import javax.net.ssl.SSLSocketFactory
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bridge between OkHttp's application and network layers. This class exposes high-level application
|
* Bridge between OkHttp's application and network layers. This class exposes high-level application
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal
|
package okhttp3.internal
|
||||||
|
|
||||||
import okio.Buffer
|
|
||||||
import java.net.IDN
|
import java.net.IDN
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
import java.util.Arrays
|
import java.util.Arrays
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
import okio.Buffer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this is an IP address, this returns the IP address in canonical form.
|
* If this is an IP address, this returns the IP address in canonical form.
|
||||||
|
@ -21,10 +21,9 @@ import okhttp3.Cookie
|
|||||||
import okhttp3.CookieJar
|
import okhttp3.CookieJar
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
|
import okhttp3.internal.toHostHeader
|
||||||
import okhttp3.internal.userAgent
|
import okhttp3.internal.userAgent
|
||||||
import okio.GzipSource
|
import okio.GzipSource
|
||||||
|
|
||||||
import okhttp3.internal.toHostHeader
|
|
||||||
import okio.buffer
|
import okio.buffer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,12 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http
|
package okhttp3.internal.http
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.ProtocolException
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.Response
|
import okhttp3.Response
|
||||||
import okhttp3.internal.EMPTY_RESPONSE
|
import okhttp3.internal.EMPTY_RESPONSE
|
||||||
import okio.buffer
|
import okio.buffer
|
||||||
import java.io.IOException
|
|
||||||
import java.net.ProtocolException
|
|
||||||
|
|
||||||
/** This is the last interceptor in the chain. It makes a network call to the server. */
|
/** This is the last interceptor in the chain. It makes a network call to the server. */
|
||||||
class CallServerInterceptor(private val forWebSocket: Boolean) : Interceptor {
|
class CallServerInterceptor(private val forWebSocket: Boolean) : Interceptor {
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
|
|
||||||
package okhttp3.internal.http
|
package okhttp3.internal.http
|
||||||
|
|
||||||
|
import java.io.EOFException
|
||||||
|
import java.net.HttpURLConnection.HTTP_NOT_MODIFIED
|
||||||
|
import java.net.HttpURLConnection.HTTP_NO_CONTENT
|
||||||
|
import java.util.Collections
|
||||||
import okhttp3.Challenge
|
import okhttp3.Challenge
|
||||||
import okhttp3.Cookie
|
import okhttp3.Cookie
|
||||||
import okhttp3.CookieJar
|
import okhttp3.CookieJar
|
||||||
@ -29,10 +33,6 @@ import okhttp3.internal.platform.Platform
|
|||||||
import okhttp3.internal.skipAll
|
import okhttp3.internal.skipAll
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
import okio.ByteString.Companion.encodeUtf8
|
import okio.ByteString.Companion.encodeUtf8
|
||||||
import java.io.EOFException
|
|
||||||
import java.net.HttpURLConnection.HTTP_NOT_MODIFIED
|
|
||||||
import java.net.HttpURLConnection.HTTP_NO_CONTENT
|
|
||||||
import java.util.Collections
|
|
||||||
|
|
||||||
private val QUOTED_STRING_DELIMITERS = "\"\\".encodeUtf8()
|
private val QUOTED_STRING_DELIMITERS = "\"\\".encodeUtf8()
|
||||||
private val TOKEN_DELIMITERS = "\t ,=".encodeUtf8()
|
private val TOKEN_DELIMITERS = "\t ,=".encodeUtf8()
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http
|
package okhttp3.internal.http
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.Call
|
import okhttp3.Call
|
||||||
import okhttp3.Connection
|
import okhttp3.Connection
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
@ -23,8 +25,6 @@ import okhttp3.Response
|
|||||||
import okhttp3.internal.checkDuration
|
import okhttp3.internal.checkDuration
|
||||||
import okhttp3.internal.connection.Exchange
|
import okhttp3.internal.connection.Exchange
|
||||||
import okhttp3.internal.connection.Transmitter
|
import okhttp3.internal.connection.Transmitter
|
||||||
import java.io.IOException
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A concrete interceptor chain that carries the entire interceptor chain: all application
|
* A concrete interceptor chain that carries the entire interceptor chain: all application
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http
|
package okhttp3.internal.http
|
||||||
|
|
||||||
import okhttp3.HttpUrl
|
|
||||||
import okhttp3.Request
|
|
||||||
import java.net.HttpURLConnection
|
import java.net.HttpURLConnection
|
||||||
import java.net.Proxy
|
import java.net.Proxy
|
||||||
|
import okhttp3.HttpUrl
|
||||||
|
import okhttp3.Request
|
||||||
|
|
||||||
object RequestLine {
|
object RequestLine {
|
||||||
|
|
||||||
|
@ -15,18 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http
|
package okhttp3.internal.http
|
||||||
|
|
||||||
import okhttp3.Interceptor
|
|
||||||
import okhttp3.OkHttpClient
|
|
||||||
import okhttp3.Request
|
|
||||||
import okhttp3.Response
|
|
||||||
import okhttp3.Route
|
|
||||||
import okhttp3.internal.closeQuietly
|
|
||||||
import okhttp3.internal.connection.RouteException
|
|
||||||
import okhttp3.internal.connection.Transmitter
|
|
||||||
import okhttp3.internal.http.StatusLine.Companion.HTTP_PERM_REDIRECT
|
|
||||||
import okhttp3.internal.http.StatusLine.Companion.HTTP_TEMP_REDIRECT
|
|
||||||
import okhttp3.internal.http2.ConnectionShutdownException
|
|
||||||
import okhttp3.internal.canReuseConnectionFor
|
|
||||||
import java.io.FileNotFoundException
|
import java.io.FileNotFoundException
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InterruptedIOException
|
import java.io.InterruptedIOException
|
||||||
@ -44,6 +32,18 @@ import java.net.SocketTimeoutException
|
|||||||
import java.security.cert.CertificateException
|
import java.security.cert.CertificateException
|
||||||
import javax.net.ssl.SSLHandshakeException
|
import javax.net.ssl.SSLHandshakeException
|
||||||
import javax.net.ssl.SSLPeerUnverifiedException
|
import javax.net.ssl.SSLPeerUnverifiedException
|
||||||
|
import okhttp3.Interceptor
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.Request
|
||||||
|
import okhttp3.Response
|
||||||
|
import okhttp3.Route
|
||||||
|
import okhttp3.internal.canReuseConnectionFor
|
||||||
|
import okhttp3.internal.closeQuietly
|
||||||
|
import okhttp3.internal.connection.RouteException
|
||||||
|
import okhttp3.internal.connection.Transmitter
|
||||||
|
import okhttp3.internal.http.StatusLine.Companion.HTTP_PERM_REDIRECT
|
||||||
|
import okhttp3.internal.http.StatusLine.Companion.HTTP_TEMP_REDIRECT
|
||||||
|
import okhttp3.internal.http2.ConnectionShutdownException
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interceptor recovers from failures and follows redirects as necessary. It may throw an
|
* This interceptor recovers from failures and follows redirects as necessary. It may throw an
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http
|
package okhttp3.internal.http
|
||||||
|
|
||||||
import okhttp3.Protocol
|
|
||||||
import okhttp3.Response
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.net.ProtocolException
|
import java.net.ProtocolException
|
||||||
|
import okhttp3.Protocol
|
||||||
|
import okhttp3.Response
|
||||||
|
|
||||||
/** An HTTP response status line like "HTTP/1.1 200 OK". */
|
/** An HTTP response status line like "HTTP/1.1 200 OK". */
|
||||||
class StatusLine(
|
class StatusLine(
|
||||||
@ -101,4 +101,4 @@ class StatusLine(
|
|||||||
return StatusLine(protocol, code, message)
|
return StatusLine(protocol, code, message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,12 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http
|
package okhttp3.internal.http
|
||||||
|
|
||||||
import okhttp3.internal.UTC
|
|
||||||
import java.text.DateFormat
|
import java.text.DateFormat
|
||||||
import java.text.ParsePosition
|
import java.text.ParsePosition
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
import okhttp3.internal.UTC
|
||||||
|
|
||||||
/** The last four-digit year: "Fri, 31 Dec 9999 23:59:59 GMT". */
|
/** The last four-digit year: "Fri, 31 Dec 9999 23:59:59 GMT". */
|
||||||
internal const val MAX_DATE = 253402300799999L
|
internal const val MAX_DATE = 253402300799999L
|
||||||
|
@ -15,6 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http1
|
package okhttp3.internal.http1
|
||||||
|
|
||||||
|
import java.io.EOFException
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.ProtocolException
|
||||||
|
import java.util.concurrent.TimeUnit.MILLISECONDS
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.HttpUrl
|
import okhttp3.HttpUrl
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
@ -39,10 +43,6 @@ import okio.ForwardingTimeout
|
|||||||
import okio.Sink
|
import okio.Sink
|
||||||
import okio.Source
|
import okio.Source
|
||||||
import okio.Timeout
|
import okio.Timeout
|
||||||
import java.io.EOFException
|
|
||||||
import java.io.IOException
|
|
||||||
import java.net.ProtocolException
|
|
||||||
import java.util.concurrent.TimeUnit.MILLISECONDS
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A socket connection that can be used to send HTTP/1.1 messages. This class strictly enforces the
|
* A socket connection that can be used to send HTTP/1.1 messages. This class strictly enforces the
|
||||||
|
@ -15,6 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http2
|
package okhttp3.internal.http2
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.util.Arrays
|
||||||
|
import java.util.Collections
|
||||||
|
import java.util.LinkedHashMap
|
||||||
import okhttp3.internal.and
|
import okhttp3.internal.and
|
||||||
import okhttp3.internal.http2.Header.Companion.RESPONSE_STATUS
|
import okhttp3.internal.http2.Header.Companion.RESPONSE_STATUS
|
||||||
import okhttp3.internal.http2.Header.Companion.TARGET_AUTHORITY
|
import okhttp3.internal.http2.Header.Companion.TARGET_AUTHORITY
|
||||||
@ -26,10 +30,6 @@ import okio.BufferedSource
|
|||||||
import okio.ByteString
|
import okio.ByteString
|
||||||
import okio.Source
|
import okio.Source
|
||||||
import okio.buffer
|
import okio.buffer
|
||||||
import java.io.IOException
|
|
||||||
import java.util.Arrays
|
|
||||||
import java.util.Collections
|
|
||||||
import java.util.LinkedHashMap
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read and write HPACK v10.
|
* Read and write HPACK v10.
|
||||||
|
@ -15,6 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http2
|
package okhttp3.internal.http2
|
||||||
|
|
||||||
|
import java.io.Closeable
|
||||||
|
import java.io.IOException
|
||||||
|
import java.io.InterruptedIOException
|
||||||
|
import java.net.Socket
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.internal.EMPTY_BYTE_ARRAY
|
import okhttp3.internal.EMPTY_BYTE_ARRAY
|
||||||
import okhttp3.internal.EMPTY_HEADERS
|
import okhttp3.internal.EMPTY_HEADERS
|
||||||
import okhttp3.internal.assertThreadDoesntHoldLock
|
import okhttp3.internal.assertThreadDoesntHoldLock
|
||||||
@ -36,11 +41,6 @@ import okio.ByteString
|
|||||||
import okio.buffer
|
import okio.buffer
|
||||||
import okio.sink
|
import okio.sink
|
||||||
import okio.source
|
import okio.source
|
||||||
import java.io.Closeable
|
|
||||||
import java.io.IOException
|
|
||||||
import java.io.InterruptedIOException
|
|
||||||
import java.net.Socket
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A socket connection to a remote peer. A connection hosts streams which can send and receive
|
* A socket connection to a remote peer. A connection hosts streams which can send and receive
|
||||||
|
@ -15,6 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http2
|
package okhttp3.internal.http2
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
|
import java.net.ProtocolException
|
||||||
|
import java.util.ArrayList
|
||||||
|
import java.util.Locale
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.Interceptor
|
import okhttp3.Interceptor
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
@ -40,11 +45,6 @@ import okhttp3.internal.http2.Header.Companion.TARGET_SCHEME_UTF8
|
|||||||
import okhttp3.internal.immutableListOf
|
import okhttp3.internal.immutableListOf
|
||||||
import okio.Sink
|
import okio.Sink
|
||||||
import okio.Source
|
import okio.Source
|
||||||
import java.io.IOException
|
|
||||||
import java.net.ProtocolException
|
|
||||||
import java.util.ArrayList
|
|
||||||
import java.util.Locale
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
/** Encode requests and responses using HTTP/2 frames. */
|
/** Encode requests and responses using HTTP/2 frames. */
|
||||||
class Http2ExchangeCodec(
|
class Http2ExchangeCodec(
|
||||||
|
@ -15,8 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http2
|
package okhttp3.internal.http2
|
||||||
|
|
||||||
import okhttp3.internal.format
|
import java.io.Closeable
|
||||||
|
import java.io.EOFException
|
||||||
|
import java.io.IOException
|
||||||
|
import java.util.logging.Level.FINE
|
||||||
|
import java.util.logging.Logger
|
||||||
import okhttp3.internal.and
|
import okhttp3.internal.and
|
||||||
|
import okhttp3.internal.format
|
||||||
import okhttp3.internal.http2.Http2.CONNECTION_PREFACE
|
import okhttp3.internal.http2.Http2.CONNECTION_PREFACE
|
||||||
import okhttp3.internal.http2.Http2.FLAG_ACK
|
import okhttp3.internal.http2.Http2.FLAG_ACK
|
||||||
import okhttp3.internal.http2.Http2.FLAG_COMPRESSED
|
import okhttp3.internal.http2.Http2.FLAG_COMPRESSED
|
||||||
@ -42,11 +47,6 @@ import okio.BufferedSource
|
|||||||
import okio.ByteString
|
import okio.ByteString
|
||||||
import okio.Source
|
import okio.Source
|
||||||
import okio.Timeout
|
import okio.Timeout
|
||||||
import java.io.Closeable
|
|
||||||
import java.io.EOFException
|
|
||||||
import java.io.IOException
|
|
||||||
import java.util.logging.Level.FINE
|
|
||||||
import java.util.logging.Logger
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads HTTP/2 transport frames.
|
* Reads HTTP/2 transport frames.
|
||||||
|
@ -15,6 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http2
|
package okhttp3.internal.http2
|
||||||
|
|
||||||
|
import java.io.EOFException
|
||||||
|
import java.io.IOException
|
||||||
|
import java.io.InterruptedIOException
|
||||||
|
import java.net.SocketTimeoutException
|
||||||
|
import java.util.ArrayDeque
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.internal.EMPTY_HEADERS
|
import okhttp3.internal.EMPTY_HEADERS
|
||||||
import okhttp3.internal.assertThreadDoesntHoldLock
|
import okhttp3.internal.assertThreadDoesntHoldLock
|
||||||
@ -27,11 +32,6 @@ import okio.BufferedSource
|
|||||||
import okio.Sink
|
import okio.Sink
|
||||||
import okio.Source
|
import okio.Source
|
||||||
import okio.Timeout
|
import okio.Timeout
|
||||||
import java.io.EOFException
|
|
||||||
import java.io.IOException
|
|
||||||
import java.io.InterruptedIOException
|
|
||||||
import java.net.SocketTimeoutException
|
|
||||||
import java.util.ArrayDeque
|
|
||||||
|
|
||||||
/** A logical bidirectional stream. */
|
/** A logical bidirectional stream. */
|
||||||
@Suppress("NAME_SHADOWING")
|
@Suppress("NAME_SHADOWING")
|
||||||
|
@ -15,6 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http2
|
package okhttp3.internal.http2
|
||||||
|
|
||||||
|
import java.io.Closeable
|
||||||
|
import java.io.IOException
|
||||||
|
import java.util.logging.Level.FINE
|
||||||
|
import java.util.logging.Logger
|
||||||
import okhttp3.internal.format
|
import okhttp3.internal.format
|
||||||
import okhttp3.internal.http2.Http2.CONNECTION_PREFACE
|
import okhttp3.internal.http2.Http2.CONNECTION_PREFACE
|
||||||
import okhttp3.internal.http2.Http2.FLAG_ACK
|
import okhttp3.internal.http2.Http2.FLAG_ACK
|
||||||
@ -35,10 +39,6 @@ import okhttp3.internal.http2.Http2.frameLog
|
|||||||
import okhttp3.internal.writeMedium
|
import okhttp3.internal.writeMedium
|
||||||
import okio.Buffer
|
import okio.Buffer
|
||||||
import okio.BufferedSink
|
import okio.BufferedSink
|
||||||
import java.io.Closeable
|
|
||||||
import java.io.IOException
|
|
||||||
import java.util.logging.Level.FINE
|
|
||||||
import java.util.logging.Logger
|
|
||||||
|
|
||||||
/** Writes HTTP/2 transport frames. */
|
/** Writes HTTP/2 transport frames. */
|
||||||
@Suppress("NAME_SHADOWING")
|
@Suppress("NAME_SHADOWING")
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.http2
|
package okhttp3.internal.http2
|
||||||
|
|
||||||
|
import java.io.IOException
|
||||||
import okhttp3.internal.and
|
import okhttp3.internal.and
|
||||||
import okio.BufferedSink
|
import okio.BufferedSink
|
||||||
import okio.BufferedSource
|
import okio.BufferedSource
|
||||||
import okio.ByteString
|
import okio.ByteString
|
||||||
import java.io.IOException
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class was originally composed from the following classes in
|
* This class was originally composed from the following classes in
|
||||||
|
@ -19,13 +19,13 @@
|
|||||||
|
|
||||||
package okhttp3.internal
|
package okhttp3.internal
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLSocket
|
||||||
import okhttp3.Cache
|
import okhttp3.Cache
|
||||||
import okhttp3.ConnectionSpec
|
import okhttp3.ConnectionSpec
|
||||||
import okhttp3.Cookie
|
import okhttp3.Cookie
|
||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.HttpUrl
|
import okhttp3.HttpUrl
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import javax.net.ssl.SSLSocket
|
|
||||||
|
|
||||||
fun parseCookie(currentTimeMillis: Long, url: HttpUrl, setCookie: String): Cookie? =
|
fun parseCookie(currentTimeMillis: Long, url: HttpUrl, setCookie: String): Cookie? =
|
||||||
Cookie.parse(currentTimeMillis, url, setCookie)
|
Cookie.parse(currentTimeMillis, url, setCookie)
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.io
|
package okhttp3.internal.io
|
||||||
|
|
||||||
import okio.Source
|
|
||||||
import okio.source
|
|
||||||
import okio.Sink
|
|
||||||
import okio.sink
|
|
||||||
import okio.appendingSink
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileNotFoundException
|
import java.io.FileNotFoundException
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
import okio.Sink
|
||||||
|
import okio.Source
|
||||||
|
import okio.appendingSink
|
||||||
|
import okio.sink
|
||||||
|
import okio.source
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access to read and write files on a hierarchical data store. Most callers should use the
|
* Access to read and write files on a hierarchical data store. Most callers should use the
|
||||||
|
@ -17,6 +17,9 @@ package okhttp3.internal.platform
|
|||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.security.NetworkSecurityPolicy
|
import android.security.NetworkSecurityPolicy
|
||||||
|
import javax.net.ssl.SSLSocket
|
||||||
|
import javax.net.ssl.SSLSocketFactory
|
||||||
|
import javax.net.ssl.X509TrustManager
|
||||||
import okhttp3.Protocol
|
import okhttp3.Protocol
|
||||||
import okhttp3.internal.platform.AndroidPlatform.Companion.isAndroid
|
import okhttp3.internal.platform.AndroidPlatform.Companion.isAndroid
|
||||||
import okhttp3.internal.platform.android.Android10CertificateChainCleaner
|
import okhttp3.internal.platform.android.Android10CertificateChainCleaner
|
||||||
@ -25,9 +28,6 @@ import okhttp3.internal.platform.android.ConscryptSocketAdapter
|
|||||||
import okhttp3.internal.platform.android.DeferredSocketAdapter
|
import okhttp3.internal.platform.android.DeferredSocketAdapter
|
||||||
import okhttp3.internal.platform.android.androidLog
|
import okhttp3.internal.platform.android.androidLog
|
||||||
import okhttp3.internal.tls.CertificateChainCleaner
|
import okhttp3.internal.tls.CertificateChainCleaner
|
||||||
import javax.net.ssl.SSLSocket
|
|
||||||
import javax.net.ssl.SSLSocketFactory
|
|
||||||
import javax.net.ssl.X509TrustManager
|
|
||||||
|
|
||||||
/** Android 29+. */
|
/** Android 29+. */
|
||||||
class Android10Platform : Platform() {
|
class Android10Platform : Platform() {
|
||||||
|
@ -16,16 +16,6 @@
|
|||||||
package okhttp3.internal.platform
|
package okhttp3.internal.platform
|
||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import okhttp3.Protocol
|
|
||||||
import okhttp3.internal.platform.android.AndroidCertificateChainCleaner
|
|
||||||
import okhttp3.internal.platform.android.CloseGuard
|
|
||||||
import okhttp3.internal.platform.android.ConscryptSocketAdapter
|
|
||||||
import okhttp3.internal.platform.android.DeferredSocketAdapter
|
|
||||||
import okhttp3.internal.platform.android.StandardAndroidSocketAdapter
|
|
||||||
import okhttp3.internal.platform.android.androidLog
|
|
||||||
import okhttp3.internal.tls.BasicTrustRootIndex
|
|
||||||
import okhttp3.internal.tls.CertificateChainCleaner
|
|
||||||
import okhttp3.internal.tls.TrustRootIndex
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.lang.reflect.InvocationTargetException
|
import java.lang.reflect.InvocationTargetException
|
||||||
import java.lang.reflect.Method
|
import java.lang.reflect.Method
|
||||||
@ -36,6 +26,16 @@ import java.security.cert.X509Certificate
|
|||||||
import javax.net.ssl.SSLSocket
|
import javax.net.ssl.SSLSocket
|
||||||
import javax.net.ssl.SSLSocketFactory
|
import javax.net.ssl.SSLSocketFactory
|
||||||
import javax.net.ssl.X509TrustManager
|
import javax.net.ssl.X509TrustManager
|
||||||
|
import okhttp3.Protocol
|
||||||
|
import okhttp3.internal.platform.android.AndroidCertificateChainCleaner
|
||||||
|
import okhttp3.internal.platform.android.CloseGuard
|
||||||
|
import okhttp3.internal.platform.android.ConscryptSocketAdapter
|
||||||
|
import okhttp3.internal.platform.android.DeferredSocketAdapter
|
||||||
|
import okhttp3.internal.platform.android.StandardAndroidSocketAdapter
|
||||||
|
import okhttp3.internal.platform.android.androidLog
|
||||||
|
import okhttp3.internal.tls.BasicTrustRootIndex
|
||||||
|
import okhttp3.internal.tls.CertificateChainCleaner
|
||||||
|
import okhttp3.internal.tls.TrustRootIndex
|
||||||
|
|
||||||
/** Android 5+. */
|
/** Android 5+. */
|
||||||
class AndroidPlatform : Platform() {
|
class AndroidPlatform : Platform() {
|
||||||
|
@ -15,14 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.platform
|
package okhttp3.internal.platform
|
||||||
|
|
||||||
import okhttp3.Protocol
|
|
||||||
import okhttp3.internal.readFieldOrNull
|
|
||||||
import org.conscrypt.Conscrypt
|
|
||||||
import java.security.Provider
|
import java.security.Provider
|
||||||
import javax.net.ssl.SSLContext
|
import javax.net.ssl.SSLContext
|
||||||
import javax.net.ssl.SSLSocket
|
import javax.net.ssl.SSLSocket
|
||||||
import javax.net.ssl.SSLSocketFactory
|
import javax.net.ssl.SSLSocketFactory
|
||||||
import javax.net.ssl.X509TrustManager
|
import javax.net.ssl.X509TrustManager
|
||||||
|
import okhttp3.Protocol
|
||||||
|
import okhttp3.internal.readFieldOrNull
|
||||||
|
import org.conscrypt.Conscrypt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Platform using Conscrypt (conscrypt.org) if installed as the first Security Provider.
|
* Platform using Conscrypt (conscrypt.org) if installed as the first Security Provider.
|
||||||
|
@ -15,12 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.platform
|
package okhttp3.internal.platform
|
||||||
|
|
||||||
import okhttp3.Protocol
|
|
||||||
import java.lang.reflect.InvocationHandler
|
import java.lang.reflect.InvocationHandler
|
||||||
import java.lang.reflect.InvocationTargetException
|
import java.lang.reflect.InvocationTargetException
|
||||||
import java.lang.reflect.Method
|
import java.lang.reflect.Method
|
||||||
import java.lang.reflect.Proxy
|
import java.lang.reflect.Proxy
|
||||||
import javax.net.ssl.SSLSocket
|
import javax.net.ssl.SSLSocket
|
||||||
|
import okhttp3.Protocol
|
||||||
|
|
||||||
/** OpenJDK 8 with `org.mortbay.jetty.alpn:alpn-boot` in the boot class path. */
|
/** OpenJDK 8 with `org.mortbay.jetty.alpn:alpn-boot` in the boot class path. */
|
||||||
class Jdk8WithJettyBootPlatform(
|
class Jdk8WithJettyBootPlatform(
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.platform
|
package okhttp3.internal.platform
|
||||||
|
|
||||||
import okhttp3.Protocol
|
|
||||||
import javax.net.ssl.SSLSocket
|
import javax.net.ssl.SSLSocket
|
||||||
import javax.net.ssl.SSLSocketFactory
|
import javax.net.ssl.SSLSocketFactory
|
||||||
import javax.net.ssl.X509TrustManager
|
import javax.net.ssl.X509TrustManager
|
||||||
|
import okhttp3.Protocol
|
||||||
|
|
||||||
/** OpenJDK 9+. */
|
/** OpenJDK 9+. */
|
||||||
open class Jdk9Platform : Platform() {
|
open class Jdk9Platform : Platform() {
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.platform
|
package okhttp3.internal.platform
|
||||||
|
|
||||||
import okhttp3.Protocol
|
|
||||||
import java.security.KeyStore
|
import java.security.KeyStore
|
||||||
import java.security.Provider
|
import java.security.Provider
|
||||||
import javax.net.ssl.SSLContext
|
import javax.net.ssl.SSLContext
|
||||||
@ -23,6 +22,7 @@ import javax.net.ssl.SSLSocket
|
|||||||
import javax.net.ssl.SSLSocketFactory
|
import javax.net.ssl.SSLSocketFactory
|
||||||
import javax.net.ssl.TrustManagerFactory
|
import javax.net.ssl.TrustManagerFactory
|
||||||
import javax.net.ssl.X509TrustManager
|
import javax.net.ssl.X509TrustManager
|
||||||
|
import okhttp3.Protocol
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Platform using OpenJSSE (https://github.com/openjsse/openjsse) if installed as the first
|
* Platform using OpenJSSE (https://github.com/openjsse/openjsse) if installed as the first
|
||||||
|
@ -16,14 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
package okhttp3.internal.platform
|
package okhttp3.internal.platform
|
||||||
|
|
||||||
import okhttp3.OkHttpClient
|
|
||||||
import okhttp3.Protocol
|
|
||||||
import okhttp3.internal.readFieldOrNull
|
|
||||||
import okhttp3.internal.tls.BasicCertificateChainCleaner
|
|
||||||
import okhttp3.internal.tls.BasicTrustRootIndex
|
|
||||||
import okhttp3.internal.tls.CertificateChainCleaner
|
|
||||||
import okhttp3.internal.tls.TrustRootIndex
|
|
||||||
import okio.Buffer
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.net.InetSocketAddress
|
import java.net.InetSocketAddress
|
||||||
import java.net.Socket
|
import java.net.Socket
|
||||||
@ -36,6 +28,14 @@ import javax.net.ssl.SSLSocket
|
|||||||
import javax.net.ssl.SSLSocketFactory
|
import javax.net.ssl.SSLSocketFactory
|
||||||
import javax.net.ssl.TrustManagerFactory
|
import javax.net.ssl.TrustManagerFactory
|
||||||
import javax.net.ssl.X509TrustManager
|
import javax.net.ssl.X509TrustManager
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.Protocol
|
||||||
|
import okhttp3.internal.readFieldOrNull
|
||||||
|
import okhttp3.internal.tls.BasicCertificateChainCleaner
|
||||||
|
import okhttp3.internal.tls.BasicTrustRootIndex
|
||||||
|
import okhttp3.internal.tls.CertificateChainCleaner
|
||||||
|
import okhttp3.internal.tls.TrustRootIndex
|
||||||
|
import okio.Buffer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access to platform-specific features.
|
* Access to platform-specific features.
|
||||||
|
@ -16,13 +16,13 @@
|
|||||||
package okhttp3.internal.platform.android
|
package okhttp3.internal.platform.android
|
||||||
|
|
||||||
import android.net.http.X509TrustManagerExtensions
|
import android.net.http.X509TrustManagerExtensions
|
||||||
import okhttp3.internal.tls.CertificateChainCleaner
|
|
||||||
import java.lang.IllegalArgumentException
|
import java.lang.IllegalArgumentException
|
||||||
import java.security.cert.Certificate
|
import java.security.cert.Certificate
|
||||||
import java.security.cert.CertificateException
|
import java.security.cert.CertificateException
|
||||||
import java.security.cert.X509Certificate
|
import java.security.cert.X509Certificate
|
||||||
import javax.net.ssl.SSLPeerUnverifiedException
|
import javax.net.ssl.SSLPeerUnverifiedException
|
||||||
import javax.net.ssl.X509TrustManager
|
import javax.net.ssl.X509TrustManager
|
||||||
|
import okhttp3.internal.tls.CertificateChainCleaner
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Android Q+ implementation of CertificateChainCleaner using direct Android API calls.
|
* Android Q+ implementation of CertificateChainCleaner using direct Android API calls.
|
||||||
@ -68,4 +68,4 @@ internal class Android10CertificateChainCleaner(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,12 +17,12 @@ package okhttp3.internal.platform.android
|
|||||||
|
|
||||||
import android.net.SSLCertificateSocketFactory
|
import android.net.SSLCertificateSocketFactory
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import okhttp3.Protocol
|
|
||||||
import okhttp3.internal.platform.AndroidPlatform.Companion.isAndroid
|
|
||||||
import okhttp3.internal.platform.Platform
|
|
||||||
import javax.net.ssl.SSLSocket
|
import javax.net.ssl.SSLSocket
|
||||||
import javax.net.ssl.SSLSocketFactory
|
import javax.net.ssl.SSLSocketFactory
|
||||||
import javax.net.ssl.X509TrustManager
|
import javax.net.ssl.X509TrustManager
|
||||||
|
import okhttp3.Protocol
|
||||||
|
import okhttp3.internal.platform.AndroidPlatform.Companion.isAndroid
|
||||||
|
import okhttp3.internal.platform.Platform
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple non-reflection SocketAdapter for Android Q.
|
* Simple non-reflection SocketAdapter for Android Q.
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user