1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-14 07:22:20 +03:00
Commit Graph

4587 Commits

Author SHA1 Message Date
Jesse Wilson
0deadd5611 Prepare for release 4.6.0. parent-4.6.0 2020-04-29 00:52:51 -04:00
Yuri Schimke
0cc3aefa8e Complies with rfc7231 about statuses 307 and 308 (#5990)
* Complies with rfc7231 about statuses 307 and 308

Author:    Vladimir Kravets <vova.kravets@gmail.com>

* Add revert test

* Remove @NotNull annotations; we don’t use ’em.

Co-authored-by: Vladimir Kravets <vova.kravets@gmail.com>
Co-authored-by: Jesse Wilson <jesse@swank.ca>
2020-04-28 18:53:27 -04:00
Jesse Wilson
269f5567ae Confirm MultipartBody and MultipartReader can work together (#5999) 2020-04-28 08:11:43 +01:00
Jesse Wilson
42954034ab Merge pull request #5998 from square/jwilson.0427.fresh_public_suffixes
Update the public suffixes DB
2020-04-27 18:52:22 -04:00
Jesse Wilson
16ca1d46c6 Update the public suffixes DB
Also check in the raw public suffixes DB into our test/ directory for
easier diffing
2020-04-27 18:45:43 -04:00
Jesse Wilson
8036ad42b0 Check in the old public suffix DB 2020-04-27 18:45:11 -04:00
Jesse Wilson
a1bc5c625d Merge pull request #5996 from square/jwilson.0427.response_body
Parse response bodies as multipart
2020-04-27 09:54:33 -04:00
Jesse Wilson
9d3eb93b8b Parse response bodies as multipart 2020-04-27 09:38:13 -04:00
Jesse Wilson
f7c66edc5c Merge pull request #5993 from square/jwilson.0426.multipart_reader
Multipart reader first steps
2020-04-27 08:45:36 -04:00
Jesse Wilson
37a7e7e9d1 Multipart reader first steps
Still to do:
 - API to get the boundary parameter from a MediaType
 - API to create a MultipartReader from a ResponseBody
 - Update to support RFC 2387 features?
2020-04-27 08:45:08 -04:00
Jesse Wilson
1f1146ea42 Add an API to look up media type parameters (#5994)
This changes our behavior for repeated charsets. Previously we would
crash; now we return the first value.
2020-04-27 08:14:37 +01:00
Jesse Wilson
f4859c763b Merge pull request #5987 from yschimke/android_fix
Fix for android test
2020-04-25 20:47:22 -04:00
Jesse Wilson
8e5d0fb9a6 Merge pull request #5988 from yschimke/disable_win
Disable Windows Builds on master
2020-04-25 20:46:38 -04:00
Yuri Schimke
26ff8512f4 Disable Windows Builds on master 2020-04-25 14:17:10 +01:00
Jesse Wilson
b09714de37 Merge pull request #5986 from yschimke/android_docs
Android docs for selecting devices
2020-04-25 07:38:54 -04:00
Yuri Schimke
27c78a7a47 Fix for android 2020-04-25 10:16:52 +01:00
monkey-mas
974fe73385 Fix Kdoc class path with full package path in JavaNetAuthenticator (#5985)
Since Kdoc needs a full path to Kotliln class/function, we'll add 'okhttp3' prefix.
2020-04-25 08:21:28 +01:00
Yuri Schimke
d56eb776e5 Android docs for selecting devices 2020-04-25 08:17:28 +01:00
Yuri Schimke
f3b2a47ce9 Java Net Authenticator (#5978)
Refactors the okhttp-urlconnection implementation.
2020-04-24 08:40:33 +01:00
Jesse Wilson
3ca806c24b Don't crash processing fragmented web sockets messages (#5983)
* Don't crash processing fragmented web sockets messages

Closes: https://github.com/square/okhttp/issues/5965

* Update okhttp-testing-support/src/main/kotlin/okhttp3/TestUtil.kt

Co-Authored-By: Jake Wharton <jakew@google.com>

* Update okhttp-testing-support/src/main/kotlin/okhttp3/TestUtil.kt

Co-Authored-By: Jake Wharton <jakew@google.com>

* Update okhttp-testing-support/src/main/kotlin/okhttp3/TestUtil.kt

Co-Authored-By: Jake Wharton <jakew@google.com>

Co-authored-by: Jake Wharton <jakew@google.com>
2020-04-23 23:31:36 -04:00
Jesse Wilson
ba21ef7e35 Merge pull request #5984 from square/masaru.2020-04-23.refactor-ssl-socket
Refactor Jdk9PlatformTest by using DelegatingSSLSocket
2020-04-23 22:49:06 -04:00
Masaru Nomura
bc3c787ea2 Refactor Jdk9PlatformTest by using DelegatingSSLSocket
Cont. https://github.com/square/okhttp/pull/5972

We can use DelegatingSSLSocket instead of overriding SSLSocket abstract class.
2020-04-23 22:41:47 -04:00
Yuri Schimke
7cfcf8e6c4 UnsupportedOperationException from JDK8 252 onwards (#5972)
* UnsupportedOperationException from JDK8 252 onwards

* typo

* semicolon

* Allow for JDK 8 with ALPN built in

* Add test

* Fix

* Fix test
2020-04-23 21:39:41 -04:00
Yuri Schimke
28404b1c3a CircleCI JDK bumps (#5974) 2020-04-22 08:05:46 +01:00
Jake Wharton
0e3c2134cb Merge pull request #5966 from square/jakew/actions/2020-04-20
Migrate from Travis to GitHub Action for publishing
2020-04-20 14:50:12 -04:00
Jake Wharton
ba5d3e278b Migrate from Travis to GitHub Action for publishing 2020-04-20 14:07:10 -04:00
Yuri Schimke
20812ac497 Simpler emulator instructions (#5962) 2020-04-19 08:26:31 +01:00
Yuri Schimke
448659eb1c Use Android API for NetworkSecurityPolicy (#5959)
* Use Android API

* Cleanup
2020-04-18 15:26:22 -04:00
Jesse Wilson
550cc11989 Merge pull request #5960 from yschimke/test_which_method_called
Test which TrustManager method called on Android
2020-04-18 15:25:39 -04:00
Yuri Schimke
65624f5f5b Avoid reflection in AndroidCertificateChainCleaner (#5961)
* Avoid reflection in AndroidCertificateChainCleaner

* clean
2020-04-18 15:24:55 -04:00
Yuri Schimke
27454cdec7 Test which TrustManager method called on Android 2020-04-18 10:08:30 +01:00
Yuri Schimke
cd72237328 Clean up SSL state in OkHttpClient (#5949)
* Clean client states

* Clean

* Fix

* Cleanup

* F

* Cleanup
2020-04-16 21:23:37 -04:00
Yuri Schimke
d51f04aaa1 More complete cancel test (#5943) 2020-04-13 07:46:43 +01:00
Yuri Schimke
d9c8fbf3b2 Confirm MockWebServer shutdown is idempotent (#5946) 2020-04-13 06:49:58 +01:00
Yuri Schimke
0730aeba9b Update followSslRedirects documentation (#5945)
* Update followSslRedirects documentation

* Update OkHttpClient.kt
2020-04-12 18:55:51 -04:00
Yuri Schimke
474b13f86b Workaround bouncycastle random issue (#5942)
* Workaround bouncycastle random issue

* Cleanup
2020-04-12 18:46:48 -04:00
Jesse Wilson
aad3aa58ea Merge pull request #5941 from square/jwilson.0411.fix_cache_on_windows
Fix DiskLruCache to work on Windows
2020-04-12 18:45:07 -04:00
Jesse Wilson
64d3b079f2 Fix DiskLruCache to work on Windows
As originally designed DiskLruCache assumes an inode-like
file system, where it's fine to delete files that are
currently being read or written.

On Windows the file system forbids this, so we must be
more careful when deleting and renaming files. These
operations come up a lot internally in the cache:
 - deleting to evict an entry
 - renaming to commit a dirty file to a clean file

The workaround is simple if unsatisfying: we don't
permit concurrent reads and writes on Windows. We
can have multiple concurrent reders, or a single
writer.

One challenge in this implementation is detecting
whether we're running on Windows or a good operating
system. We deliberately don't look at System properties
here because the OS and file system may disagree, such
as when a Windows machine has an ext4 partition, or when
a Linux machine has an NTFS partition. Instead of detecting
we just attempt an edit and see what happens.

Another challenge in this implementation is what to
do when a file needs to be deleted but cannot be because
it is currently open. In such cases we now mark the
cache entry as a 'zombie'. When the files are later
closed they now check for zombie status and delete the
files if necessary. Note that it is not possible to
store a new cache entry while it is a zombie.

Closes: https://github.com/square/okhttp/issues/5761
2020-04-11 20:16:40 -04:00
Yuri Schimke
67453eeb40 Revert to null SecureRandom (#5939)
Short lived change to enable BouncyCastle on Android.
2020-04-11 19:00:55 +01:00
Yuri Schimke
86b7ba5f2a Enable BouncyCastle on Android and add some testing (#5936) 2020-04-11 17:35:27 +01:00
Yuri Schimke
3b390e18c6 Confirm basic cancel behaviour in test (#5937) 2020-04-11 17:19:41 +01:00
Yuri Schimke
19771365f2 Rename to src/main/kotlin (#5938)
Follows the default path logic for kotlin classes.
2020-04-11 17:15:25 +01:00
Jesse Wilson
d2e55a0506 Merge pull request #5931 from square/jwilson.0410.reverse_engineer
Emulate Windows file system restrictions in a wrapper
2020-04-11 11:13:14 -04:00
Jesse Wilson
ac53284db4 Emulate Windows file system restrictions in a wrapper
This should make it possible to get DiskLruCacheTest passing on
Windows even when Windows isn't available.
2020-04-11 11:12:56 -04:00
Jesse Wilson
1379c599cf Merge pull request #5934 from square/jwilson.0410.bc_165
Upgrade Bouncy Castle to to 1.65
2020-04-11 00:46:31 -04:00
Jesse Wilson
02052b01f6 Convert DiskLruCacheTest to Kotlin (#5933)
* Rename DiskLruCacheTest.java to DiskLruCacheTest.kt

* Convert DiskLruCacheTest to Kotlin
2020-04-11 00:46:03 -04:00
Jesse Wilson
18be1bad70 Upgrade Bouncy Castle to to 1.65
From the project's release notes:

    Defects Fixed

    DLExternal would encode using DER encoding for tagged SETs. This has been fixed.
    ChaCha20Poly1305 could fail for large (>~2GB) files. This has been fixed.
    ChaCha20Poly1305 could fail for small updates when used via the provider. This has been fixed.
    Properties.getPropertyValue could ignore system property when other local overrides set. This has been fixed.
    The entropy gathering thread was not running in daemon mode, meaning there could be a delay in an application shutting down due to it. This has been fixed.
    A recent change in Java 11 could cause an exception with the BC Provider's implementation of PSS. This has been fixed.
    BCJSSE: TrustManager now tolerates having no trusted certificates.
    BCJSSE: Choice of credentials and signing algorithm now respect the peer's signature_algorithms extension properly.
    BCJSSE: KeyManager for KeyStoreBuilderParameters no longer leaks memory.

    Additional Features and Functionality

    LMS and HSS (RFC 8554) support has been added to the low level library and the PQC provider.
    SipHash128 support has been added to the low level library and the JCE provider.
    BCJSSE: BC API now supports explicitly specifying the session to resume.
    BCJSSE: Ed25519, Ed448 are now supported when TLS 1.2 or higher is negotiated (except in FIPS mode).
    BCJSSE: Added support for extended_master_secret system properties: jdk.tls.allowLegacyMasterSecret, jdk.tls.allowLegacyResumption, jdk.tls.useExtendedMasterSecret .
    BCJSSE: Ed25519, Ed448 are now supported when TLS 1.2 or higher is negotiated (except in FIPS mode).
    BCJSSE: KeyManager and TrustManager now check algorithm constraints for keys and certificate chains.
    BCJSSE: KeyManager selection of server credentials now prefers matching SNI hostname (if any).
    BCJSSE: KeyManager may now fallback to imperfect credentials (expired, SNI mismatch).
    BCJSSE: Client-side OCSP stapling support (beta version: via status_request extension only, provides jdk.tls.client.enableStatusRequestExtension, and requires CertPathBuilder support).
    TLS: DSA in JcaTlsCrypto now falls back to stream signing to work around NoneWithDSA limitations in default provider.

https://www.bouncycastle.org/releasenotes.html
2020-04-10 18:27:52 -04:00
Yuri Schimke
8dcd39dbdc Public API for Pins (#5927)
Make Pin a public API and expose via getters on CertificatePinner.
2020-04-10 18:00:42 +01:00
Yuri Schimke
b3b788a942 Upgrade to Android 10 APIs when available (#5821)
* Upgrade robolectric dependency

* cleanup

* Suppress animal sniffer checks on known classes

* Update build.gradle

* Update build.gradle
2020-04-10 10:42:29 -04:00
Jesse Wilson
91f16b4354 Merge pull request #5928 from yschimke/androidx_test
Migrate to AndroidX for tests
2020-04-10 10:38:08 -04:00