1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-12 10:23:16 +03:00
Commit Graph

4692 Commits

Author SHA1 Message Date
Jesse Wilson
63dcd95bfa Prepare for release 4.9.1. parent-4.9.1 2021-01-30 13:09:57 -05:00
Jesse Wilson
d2e28ab672 Silently ignore 'bio == null' NullPointerExceptions (#6534)
Closes: https://github.com/square/okhttp/issues/6509
2021-01-30 12:56:45 -05:00
Jesse Wilson
cbeaf8f955 Prepare for release 4.9.0. parent-4.9.0 2020-09-11 17:08:20 -04:00
Yuri Schimke
8fd74a7482 Conscrypt 2.5.1 Upgrade (#6263) 2020-09-11 16:40:20 -04:00
Yuri Schimke
2bd749dd9d Kotlin 1.4.10 Upgrade (#6264) 2020-09-11 11:23:09 -04:00
Yuri Schimke
0164696a8a Fix build on windows (#6257)
Issue relates to default encoding picked up for daemons affecting compile, previous approach was launch property which doesn't affect Gradle daemons.
2020-09-10 06:45:43 +01:00
Yuri Schimke
e4c3b28c39 Fix HttpUrl documentation (#6259) 2020-09-09 21:48:40 -04:00
Jesse Wilson
8c2f383f14 Document interceptor throwing modes (#6235) 2020-09-09 21:48:06 -04:00
Yuri Schimke
a76c40a935 Kotlin 1.4 dependency upgrade and language features (#5947) 2020-09-06 16:36:12 +01:00
Thomas Wirth
1589741a90 Fix Caching documentation. (#6247) 2020-09-04 07:27:54 -04:00
Russell
45010c58a0 Add "MockWebServer" as a known logger (#6229) 2020-08-26 17:35:44 +03:00
Lavong Soysavanh
dbb2c346e7 Update https.md (#6234)
fix link
2020-08-23 16:24:04 -04:00
Yuri Schimke
504faef750 Conscrypt 2.5.0 upgrade (#6228)
Conscrypt 2.5.0 upgrade with a workaround for changed Conscrypt API
2020-08-20 21:27:00 +01:00
Jesse Wilson
96a2118dd4 Release OkHttp 4.8.1. 2020-08-06 10:07:13 -04:00
Jesse Wilson
b1963bf8d8 Implement DER constraints on date formats (#6213)
The time zone must be 'Z', and cannot be an offset like '+0000'. That
is allowed by ASN.1 but not by DER.

Closes: https://github.com/square/okhttp/issues/6210
2020-08-05 19:50:44 -04:00
Yuri Schimke
9724946320 Avoid DefaultImpls bug (#6198)
* Avoid DefaultImpls bug

* private classes
2020-07-25 09:43:50 -04:00
Yuri Schimke
d2c5a74def Allow missing SAN in certificates (#6186) 2020-07-16 06:34:27 -04:00
Jesse Wilson
6aae409a3e Don't install the Bouncy Castle provider in HeldCertificate (#6183)
This potentially changes behavior for applications requiring security
features that are available in Bouncy Castle but not the platform. To
mitigate this, execute this before such operations:

    Security.addProvider(BouncyCastleProvider())

You will also need to configure this dependency:

    implementation "org.bouncycastle:bcprov-jdk15on:1.65"
2020-07-12 11:59:51 -04:00
Jesse Wilson
548f601f69 Fix some issues discovered by simple fuzzing (#6181)
We were throwing IllegalArgumentException or ParseException but
want to throw only ProtocolException or EOFException.
2020-07-11 20:03:35 -04:00
Jesse Wilson
828587ae43 Fix a broken link in the changelog 2020-07-11 15:06:11 -04:00
Jesse Wilson
d479b0e41c Prepare next development version. 2020-07-11 14:01:11 -04:00
Jesse Wilson
a70e992c3f Prepare for release 4.8.0. parent-4.8.0 2020-07-11 14:01:06 -04:00
Jesse Wilson
cf367d9339 Add defensive checks for malformed ASN.1 DER (#6180)
If the date is before 1950-01-01, use a four-digit year

If the self-delimiting object identifer exceeds the enclosing object's
size, fail.

If a nested object exceeds its enclosing object's size, fail.
2020-07-11 10:38:11 -04:00
Jesse Wilson
0e0f3a2d8d Push OkHttp 3.14.x into the sea. It is no longer supported. (#6179)
OkHttp 4.x is our only branch receiving security fixes, bug fixes, and
new features.

OkHttp 3.12.x gets security fixes only.
2020-07-11 11:04:10 +01:00
Maciej Górski
7c9cfd6b28 Fix typo (#6178) 2020-07-10 08:48:21 -04:00
Jesse Wilson
4bfa33e09a Upgrade to Okio 2.7.0 (#6175) 2020-07-09 08:42:39 +01:00
Jesse Wilson
c4cbb57a46 Don't crash on unknown GeneralName types. (#6170)
We don't have API support for all of them, but we shouldn't crash when an
unsupported name is encountered.

Also encode attributes using UTF-8, not PrintableString. Both are permitted,
but UTF-8 supports more data.
2020-07-06 09:38:00 +01:00
Jesse Wilson
19e9a8ffd3 Drop support for indefinite length in DER (#6166)
This is a feature of ASN.1 that DER doesn't use, and in fact it forbids.
2020-07-05 08:12:29 +01:00
cketti
c04b57edac Add limits to what length values DerReader supports (#6164)
* Add limits to what length values DerReader supports

With this change DerReader doesn't support reading values with a length
greater than Long.MAX_VALUE. That shouldn't be a problem in practice.

* Make DerReader check length is encoded in shortest form possible

* Spotless and IntelliJ disagree on import order

Co-authored-by: Jesse Wilson <jesse@swank.ca>
2020-07-03 08:47:25 -04:00
Jesse Wilson
353a52b970 Improve code style for the new DER package (#6157)
Improve docs, fix some names, fix some internal APIs.
2020-06-30 06:14:49 +01:00
Jesse Wilson
45df82e15b Honor RFC 5280 when choosing a time format (#6154)
We switch to 4-digit years at the last possible moment.
2020-06-29 10:11:13 -04:00
Jesse Wilson
ca803de0d2 Stop using Bouncycastle to do PKCS8 to PKCS1 (#6153)
PKCS8 is a PrivateKeyInfo
PKCS1 is the private key field of a PKCS8

We need to do a simple unboxing to go from one to the other.
2020-06-28 14:38:22 -04:00
Jesse Wilson
8e78ed04ae Use OkHttp's certificate creation code (#6152)
We don't implement the full feature set that Bouncycastle has, but
we also don't need it.

In follow up changes I intend to remove the Bouncycastle dependency
for everything but some test cases.
2020-06-28 11:47:56 -04:00
Jesse Wilson
c3d453c1b9 Fix bugs so we can roundtrip certificates (#6151)
This gets us to the point where the byte-for-byte encoding is equiavalent
to what bouncycastle was producing.

This shook out some bugs:
 - We weren't boxing the version
 - We weren't clearing the constructed bit on boxed extensions
 - We weren't encoding null when we needed to be
2020-06-28 08:02:31 +01:00
Jesse Wilson
6e212cd7f5 Move tag management in DerAdapters (#6148)
Previously the caller was responsible for decoding the tag on the
adapter it called. This was easy for basic tags, but proved problematic
for tags like CHOICE and ANY and typehint-dependent tags, because the
caller didn't have enough information.

This moves the tag reading and writing into the DerAdapter itself. If
it encounters a tag it can't understand, it assumes it's own value has
been skipped and returns a default.

This turns out to be a bit easier to reason about, and hopefully will
make it easier to implement AlgorithmIdentifier.parameters, which has
values that are optional or not depending on what the type hint is.
2020-06-27 14:50:52 -04:00
Jesse Wilson
e90b33d686 Document common security issues on older Android devices (#6150)
This is ychimke's update, just moved to another file and copy-edited to cover
both Android and JVM handshakes.
2020-06-27 14:12:50 -04:00
Jesse Wilson
70f12ff56f Limited support for decoding extensions (#6145) 2020-06-25 18:51:26 -04:00
Jesse Wilson
e736f927f8 DER encoder (#6139)
I haven't yet implemented certificate encoding
2020-06-25 07:17:29 -04:00
PY
936a3cd77b Update FileOperator.kt (#6141)
Update FileOperator.read doc typo
2020-06-22 13:48:28 -04:00
Jesse Wilson
653a446092 Early implementation of an ASN.1 DER decoder (#6135)
* Early implementation of an ASN.1 DER decoder

My goal is to finish the implementation to support an ASN.1 DER encoder
and then to change okhttp-tls to no longer depend on BouncyCastle.

* Update okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerReader.kt

Co-authored-by: Benoît Quenaudon <bquenaudon@squareup.com>

Co-authored-by: Benoît Quenaudon <bquenaudon@squareup.com>
2020-06-20 20:33:59 -04:00
Yuri Schimke
93b5a1af75 Fix openjsse CI (#6127)
Revert to docket image with Java 8 available.
2020-06-17 08:25:56 +01:00
Yuri Schimke
c7bd25ff21 Yubikey sample (#6120) 2020-06-10 22:03:20 -04:00
Jesse Wilson
a06606eb32 Merge branch 'jwilson.0610.defer_conscrypt'
* jwilson.0610.defer_conscrypt:
  Another layer of indirection to defer Conscrypt init (#6066)
2020-06-10 22:02:48 -04:00
Yuri Schimke
d8f02f4efe Another layer of indirection to defer Conscrypt init (#6066) 2020-06-10 22:01:51 -04:00
Yuri Schimke
dad673f7bc Test client auth failure events (#6117) 2020-06-10 21:58:31 -04:00
Yuri Schimke
665b6a7f41 Dependency upgrades (#6114) 2020-06-10 21:58:14 -04:00
Yuri Schimke
3a5f3620d8 Allow for domain name trailing dot in PublicSuffixDatabase (#6111) 2020-06-10 21:58:07 -04:00
Jesse Wilson
b086b8d183 Merge pull request #6104 from yschimke/avoid_bouncy_cancels
Avoid BouncyCastle failures
2020-06-01 22:23:05 -04:00
Yuri Schimke
e5c8461dbf Clarify Interceptor timeout docs (#6102) 2020-06-01 07:56:32 +01:00
Yuri Schimke
cfbca0e311 Simplify running the wireshark demo (#6101)
* Simplify running the wireshark demo

* Better filtering

* Cleanup

* Comments
2020-05-31 15:38:02 -04:00