1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-23 06:42:24 +03:00
Commit Graph

133 Commits

Author SHA1 Message Date
Yuri Schimke
362f53546d Adopt Version Catalog and Updates plugin (#7075) 2022-02-15 23:38:32 +00:00
Goooler
f5758b7f26 Enable Gradle's type-safe project accessors (#7069) 2022-02-08 20:01:28 +00:00
Jesse Wilson
c30d9ad14b Convert more tests to Kotlin (#6980) 2022-01-05 00:20:25 -05:00
Goooler
8debc78b00 Simplify gradle kts (#6931) 2021-11-27 12:31:27 +00:00
Jesse Wilson
d9a65a85c5 Switch to Vanniktech for Maven publishing (#6929)
* Switch to Vanniktech for Maven publishing

Steal configuration from Okio, which already works nicely.

* Update mockwebserver-junit5/build.gradle.kts

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

Co-authored-by: Benoît Quenaudon <bquenaudon@squareup.com>
2021-11-26 06:58:00 -05:00
Goooler
d0759a7907 Simplify kts (#6926)
* Simplify kts

* Use extensions

* Use extensions

* Simplify kts
2021-11-25 19:41:08 -05:00
Goooler
3417fd0e78 Update README files to 4.9.3 (#6927) 2021-11-24 09:34:33 -05:00
Jesse Wilson
35bb1740a4 Convert the main build.gradle file to KTS (#6925)
I attempted to do a literal translation as much as possible.
Subprojects now need plugins to be configured directly so they
can use the appropriate syntax.
2021-11-24 07:19:39 +00:00
Jesse Wilson
a87f4b4585 Changelog for OkHttp 4.9.2 2021-09-30 21:13:35 -04:00
Goooler
e1af67f082 Declare types & Cleanup (#6842)
* Declare types

* Code cleanup

* Declare types
2021-08-30 23:32:43 -04:00
Goooler
e016350e5a Convert module gradle builds files to kts (#6830) 2021-08-12 08:36:23 +01:00
Goooler
8e8c2a6037 Code cleanup (#6831) 2021-08-12 08:26:27 +01:00
Goooler
90f8a7d26f Refactor applyOsgi & baselineJar to kotlin (#6823) 2021-08-12 07:52:29 +01:00
Goooler
cc3ce11fc4 Code cleanup and imports (#6822) 2021-08-03 14:52:10 +03:00
Goooler
b668b75f11 Replace deprecated methods (#6776) 2021-07-29 10:08:34 +03:00
Goooler
7f4b97e8a4 Update docs to use https (#6642) 2021-04-22 08:30:57 +01:00
Yuri Schimke
690cfa9b43 Fix animal sniffer build (#6635) 2021-04-15 08:41:10 +01:00
Goooler
ef5d0c83f7 Update README files to 4.9.1 (#6617) 2021-04-10 07:42:40 +01:00
Yuri Schimke
b607bb0aa8 Partial move to gradle kotlin (#6532) 2021-02-06 14:57:47 +00:00
Yuri Schimke
168cbffb6e Fail on unencodable keys (#6468) 2020-12-28 20:46:01 -05:00
Yuri Schimke
ec1d18d143 Quick Android Test Fixes (#6428) 2020-11-21 09:50:01 +00:00
Yuri Schimke
d1cf4944f2 Junit import fail (#6429)
* Missed some imports

* Missed some imports

* Missed some imports
2020-11-19 21:23:18 -05:00
Yuri Schimke
25814afb80 Move tls tests to Junit 5 (#6372) 2020-11-01 09:12:12 -05:00
Jesse Wilson
59ae0c138d Convert more tests to JUnit 5 (#6366) 2020-11-01 05:46:35 +00:00
Simon Wimmesberger
b4d66af1da Publish OSGi metadata for OkHttp 2020-10-06 22:40:28 -04:00
Jesse Wilson
c13cabdba6 Fix docs on privateKeyPkcs8Pem() to not require RSA (#6306)
PKCS #1 is RSA-only
PKCS #8 is any key
2020-10-05 11:54:27 -04:00
Jesse Wilson
cbeaf8f955 Prepare for release 4.9.0. 2020-09-11 17:08:20 -04: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
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
a70e992c3f Prepare for release 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
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
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
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
488de3f6d1 Fix for conscrypt error parsing certificates (#6098)
Fails with a runtime exception on bad input.
2020-05-29 08:01:30 +01:00
Jesse Wilson
4c595553fb Prepare for release 4.7.2. 2020-05-20 09:06:47 -04:00
Jesse Wilson
186ec88aff Prepare for release 4.7.1. 2020-05-18 17:46:48 -04:00
Yuri Schimke
67f77be6b0 Fix for insecureHost on Android (#6063) 2020-05-18 20:23:00 +01:00