Martin Algesten
7a73fa1871
cargo fmt
2020-06-15 09:33:08 +02:00
k3d3
de3416e260
Fix cfg for test
...
Fix up cfg attributes to work on an xor basis.
Previously, the cfg(any()) attributes would cause issues when
both native-tls and tls features were enabled. Now, https functions
and enum variants will only be created when tls xor native-tls are
enabled. Additionally, a compile error has been added for when
both tls and native-tls features are enabled.
2020-06-15 09:25:49 +02:00
k3d3
9f7f712dde
Add optional native-tls support, clear up warnings for flag configurations
2020-06-15 09:25:49 +02:00
Jacob Hoffman-Andrews
378ef57636
Fix findings from cargo clippy.
2020-06-15 09:11:43 +02:00
Jacob Hoffman-Andrews
b4c15eef2c
Check for server closed connections.
...
This builds on 753d61b . Before we send a request, we can do a 1-byte
nonblocking peek on the connection. If the server has closed the
connection, this will give us an EOF, and we can take the connection out
of the pool before sending any request on it. This will reduce the
likelihood that we send a non-retryable POST on an already-closed
connection.
The server could still potentially close the connection between when we
make this check and when we finish sending the request, but this should
handle the majority of cases.
2020-06-15 09:11:25 +02:00
Martin Algesten
aa3e9b1ecf
ensure overall connect timeout
2020-05-23 09:28:16 +02:00
David Wolinsky
1842a00da5
Try all sock_addrs before erroring on connect
...
If DNS resolves to multiple IPs but the service is only running on one
of them and it isn't teh first IP, a connection will fail.
This was detected via running vault that would only bind to IPv4 but
localhost was returning ::1 followed by 127.0.0.1.
After this fix, the service connects without problem.
2020-05-23 08:56:33 +02:00
Rob Young
2e3a75166d
Allow TLS client config to be overridden
...
See: https://docs.rs/rustls/latest/rustls/struct.ClientConfig.html
2020-05-20 20:54:04 +02:00
Martin Algesten
49b6072921
cargo fmt
2020-05-06 13:48:52 +02:00
sklv
8f2d094cef
SOCKS5: If host is domain use proxy for DNS.
2020-04-18 11:47:50 +02:00
Martin Algesten
a75d924f96
fix some warnings by moving imports around
2020-04-18 11:47:49 +02:00
sklv
92b4e7ec2c
Add TODO for supporting timeouts in Socks5Proxy.
2020-04-18 11:47:47 +02:00
sklv
a598b1091b
Add comment explaining thread::spawn timeout.
2020-04-18 11:47:44 +02:00
sklv
9928559067
Make SOCKS5 connection respect timeout_connect.
2020-04-18 11:47:37 +02:00
sklv
05ce690ebd
Add initial SOCKS5 support.
2020-04-18 11:47:30 +02:00
Koga Kazuo
e5fa36f98e
Fix panic on invalid authority
2020-04-12 09:41:35 +02:00
Nicolas Viennot
31ae90e614
Use platform certificates when target "native-certs" is set
...
This is useful in Entreprise configurations.
2020-04-12 09:08:52 +02:00
rustysec
3b0df412ef
initial proxy impl
2020-03-14 09:54:54 +01:00
Martin Algesten
2956683870
bump deps, fix clippy warnings
2020-03-14 09:54:54 +01:00
Razvan Rotari
09dabbdd49
Disable the native system timeout for socket
2020-01-17 23:15:26 +01:00
Martin Algesten
e936d5ea74
cargo fmt
2019-10-20 10:41:35 +02:00
Martin Algesten
c2bb5a9592
fix test --no-default-features
2019-09-14 08:41:59 +02:00
Chris West (Faux)
580e159268
handle server CloseNotifying connection
2019-09-09 19:52:48 +01:00
Chris West (Faux)
ceb7c3ac14
use pub(crate) instead of include!()
2019-05-27 17:44:14 +01:00
Chris West (Faux)
73d1c89e90
rustfmt
2019-05-27 17:25:43 +01:00
Martin Algesten
a89150eee7
fix warning in --no-default-features
2019-03-30 11:34:35 +01:00
Martin Algesten
22e83fc31c
fixes for no-default-features
2019-02-03 12:05:27 +05:30
Martin Algesten
07fd4d2cd5
pub(crate) where we can
2018-12-20 11:08:20 +01:00
Martin Algesten
707d194b74
rustls instead of native-tls
2018-12-19 10:30:43 +01:00
Martin Algesten
5ba6b3cd4d
edition 2018, clippy, fmt
2018-12-18 13:17:19 +01:00
Martin Algesten
2c9e62ad8c
fix dealloc issues
2018-10-23 20:18:24 +01:00
Martin Algesten
99ad96b212
explicit shutdown on tls connections
2018-10-22 19:19:58 +01:00
Martin Algesten
bf97aa9fc8
fix building without tls. close #1
2018-09-01 13:47:51 +02:00
Martin Algesten
03928a05c5
tidy up
2018-07-01 10:19:40 +02:00
Martin Algesten
548b5d80c2
test poolable against s3
2018-06-30 23:05:40 +02:00
Martin Algesten
4a5944443f
connection pooling
2018-06-30 16:52:54 +02:00
Martin Algesten
54558fbb26
refactor to body
2018-06-30 14:11:54 +02:00
Martin Algesten
0e4c326caf
tidy
2018-06-30 14:01:13 +02:00
Martin Algesten
ff582b8c6f
separate out stream
2018-06-30 13:47:37 +02:00
Martin Algesten
3b249e0313
separate out ConnectionPool
2018-06-30 13:41:52 +02:00
Martin Algesten
b54f747d16
separate out response
2018-06-30 13:36:41 +02:00
Martin Algesten
f5a4c83819
refactor into unit
2018-06-30 13:05:36 +02:00
Martin Algesten
0334f9608b
updated deps
2018-06-30 10:30:05 +02:00
Martin Algesten
fc4a78b962
ToSocketAddrs instead of dns lookup
2018-06-26 08:26:44 +02:00
Martin Algesten
cd4a1722fa
reduce dependency tree by features
2018-06-22 15:02:13 +02:00
Martin Algesten
d7ebe52df2
Stream::Read -> Stream::Cursor
2018-06-14 17:02:29 +02:00
Martin Algesten
7177a99d1f
move connect calls to stream
2018-06-14 14:38:00 +02:00
Martin Algesten
ef6f8c6259
rustls -> native_tls
2018-06-14 14:17:39 +02:00
Martin Algesten
d4126027c8
cookie jar
2018-06-12 23:09:17 +02:00
Martin Algesten
d548b3ef4f
simple test harness
2018-06-12 01:30:46 +02:00