Commit graph

906 commits

Author SHA1 Message Date
nicholas a. evans
331005812f
[ruby/net-imap] Move each authenticator to its own file
Also updates rdoc with SASL specifications and deprecations.  Of these
four, only `PLAIN` isn't deprecated!

+@@authenticators+ was changed to a class instance var
+@authenticators+.  No one should have been using the class variable
directly, so that should be fine.

23f241b081
2021-05-06 15:20:33 +09:00
Ryuta Kamizono
908785ef6d [ruby/net-imap] Fix typo intentionaly -> intentionally [ci skip]
4057c662e7
2021-04-28 11:10:52 +09:00
Jeremy Evans
0296a64450 [ruby/net-http] Initialize OpenSSL early before creating TCPSocket
OpenSSL make take some time to initialize, and it would be best
to take that time before connecting instead of after.

From joshc on Redmine.

Fixes Ruby Bug #9459

14e09fba24
2021-04-28 11:03:12 +09:00
Jean Boussier
1229ad0528 [ruby/net-http] Fix the regexp used to clean the host
Introduced in c165203564

`/s` marks the regexp as encoded with Windows-31J which makes little
sense.

Nurse thinks the intent was to use `/m` for a multi-line regexp.

6c15342cdf
2021-04-28 11:01:41 +09:00
Lukas Eipert
842f00f452 [ruby/net-http] Decode user and password from env configured proxy
If someone sets an env variable defining a http_proxy, containing a
username / password with percent-encoded characters, then the resulting
base64 encoded auth header will be wrong.

For example, suppose a username is `Y\X` and the password is `R%S] ?X`.
Properly URL encoded the proxy url would be:

    http://Y%5CX:R%25S%5D%20%3FX@proxy.example:8000

The resulting proxy auth header should be: `WVxYOlIlU10gP1g=`, but the
getters defined by ruby StdLib `URI` return a username `Y%5CX` and
password `R%25S%5D%20%3FX`, resulting in `WSU1Q1g6UiUyNVMlNUQlMjAlM0ZY`.
As a result the proxy will deny the request.

Please note that this is my first contribution to the ruby ecosystem, to
standard lib especially and I am not a ruby developer.

References:

- https://gitlab.com/gitlab-org/gitlab/-/issues/289836
- https://bugs.ruby-lang.org/projects/ruby-master/repository/trunk/revisions/58461
- https://bugs.ruby-lang.org/issues/17542

e57d4f38aa
2021-04-28 11:01:23 +09:00
mohamed
8a2b7b79ee [ruby/net-http] Replace Timeout.timeout in Net:HTTP#connect
Use Socket.tcp's connect_timeout option instead

753cae3bbc
2021-04-28 10:58:13 +09:00
Tom Freudenberg
e22626f08e [ruby/net-smtp] mod: bump to a new VERSION that could be checked for testings >0.2.1
8f2c9323e2
2021-04-28 10:51:10 +09:00
Hiroshi SHIBATA
eebecdf1c4 [ruby/net-smtp] Removed needless files from Gem::Specification#files
69bba6b125
2021-04-28 10:48:13 +09:00
mohamed
ff931d0336 [ruby/net-smtp] Replace Timeout.timeout with socket timeout
Timeout.timeout is inefficient since it spins up a new thread for
each invocation, use Socket.tcp's connect_timeout option instead

6ae4a59f05
2021-04-28 10:47:29 +09:00
Tom Freudenberg
4c8cce5b8a [ruby/net-smtp] Net::SMTP.start() and #start() accepts ssl_context_params keyword argument
Additional params are passed to OpenSSL::SSL::SSLContext#set_params.

	For example, `Net::SMTP#start(ssl_context_params: { cert_store: my_store, timeout: 123 })`
	calls `set_params({ cert_store: my_store, timeout: 123 })`.

4213389c21
2021-04-28 10:46:38 +09:00
Gannon McGibbon
1b2abb6590 [ruby/net-ftp] Replace "iff" with "if and only if"
iff means if and only if, but readers without that knowledge might
assume this to be a spelling mistake. To me, this seems like
exclusionary language that is unnecessary. Simply using "if and only if"
instead should suffice.

e920473618
2021-04-27 21:22:56 +09:00
Shugo Maeda
4ae27d8075
[ruby/net-ftp] Reduce resource cosumption of Net::FTP::TIME_PARSER
Reported by Alexandr Savca as a DoS vulnerability, but Net::FTP is a
client library and the impact of the issue is low, so I have decided
to fix it as a normal issue.
Based on patch by nobu.

a93af636f8
2021-04-27 21:21:33 +09:00
Jeremy Evans
990baec411 [ruby/net-ftp] Close the passive connection data socket if there is an error setting up the transfer
Previously, the connection leaked in this case.  This uses
begin/ensure and checking for an error in the ensure block.

An alternative approach would be to not even perform the
connection until after the RETR (or other) command has been
sent.  However, I'm not sure all FTP servers support that.
The current behavior is:

* Send (PASV/EPSV)
* Connect to the host/port returned in 227/229 reply
* Send (RETR/other command)

Changing it to connect after the RETR could break things.
FTP servers might expect that the client has already
connected before sending the RETR.  The alternative
approach is more likely to introduce backwards compatibility
issues, compared to the begin/ensure approach taken here.

Fixes Ruby Bug 17027

6e8535f076
2021-04-27 21:21:00 +09:00
mohamed
a86c6cb34d [ruby/net-ftp] Replace Timeout.timeout with socket timeout
Timeout.timeout is inefficient since it spins up a new thread for
each invocation, use Socket.tcp's connect_timeout option instead
when we aren't using SOCKS (we can't replace Timeout.timeout
for SOCKS yet since SOCKSSocket doesn't have a connect_timeout
option).

d65910132f
2021-04-27 21:20:48 +09:00
Shugo Maeda
a9fe00c3ba [ruby/net-imap] Bump version to 0.2.1
31f96ea884
2021-04-22 14:38:32 +09:00
Shugo Maeda
d785c5b8b2 [ruby/net-imap] Set timeout for IDLE responses
Fixes #14

39d39ff9bb
2021-04-22 14:38:23 +09:00
Hiroshi SHIBATA
674760316c
Merge net-imap-0.2.0 2021-04-22 14:37:45 +09:00
aycabta
66d2fc7989 Enclose the code that was accidentally a link in "tt" 2021-03-31 15:18:52 +09:00
Gannon McGibbon
37258b64c7
[ruby/net-http] Replace "iff" with "if and only if"
iff means if and only if, but readers without that knowledge might
assume this to be a spelling mistake. To me, this seems like
exclusionary language that is unnecessary. Simply using "if and only if"
instead should suffice.

ffb87cad32
2021-01-23 10:20:28 +09:00
Igor Zubkov
ee1e690a2d
We don't need "require 'uri'" after "require 'net/http'". 2021-01-07 13:40:42 +09:00
Hiroshi SHIBATA
9b9cbbbc17
Update library versions of the default gems.
They are followed up with
  8fb02b7a97
2020-12-22 21:45:28 +09:00
Hiroshi SHIBATA
d3c685f0b5
digest gem is available now 2020-12-03 19:17:29 +09:00
Hiroshi SHIBATA
28001e55b3
Added dependencies for net-pop 2020-12-02 19:36:06 +09:00
Hiroshi SHIBATA
1fa3f9a1b5
Added dependencies for net-imap 2020-12-02 19:36:06 +09:00
Hiroshi SHIBATA
7172272c4c
Added dependencies for net-ftp 2020-12-02 09:12:26 +09:00
Hiroshi SHIBATA
afba96f9f5
Added dependencies for net-http 2020-12-02 09:12:25 +09:00
Hiroshi SHIBATA
48149d8fe7
Added dependencies for net-smtp 2020-12-02 09:12:25 +09:00
Hiroshi SHIBATA
b0f4cccfae
Added dependencies for net-protocol 2020-12-02 09:12:25 +09:00
Hiroshi SHIBATA
dc3a65bd99
[ruby/net-smtp] Bump version to 0.2.1
6e5c09dcc4
2020-11-18 16:28:46 +09:00
Hiroshi SHIBATA
cada6d85d0
Import net-smtp-0.2.0 from https://github.com/ruby/net-smtp 2020-11-17 14:17:45 +09:00
Hiroshi SHIBATA
037803e092
Added dependency for net-protocol 2020-11-06 17:42:57 +09:00
Nobuyoshi Nakada
3198e7abd7
Separate send into public_send and __send__ 2020-10-27 16:12:45 +09:00
nicholas a. evans
f1d32010e6 [ruby/net-smtp] Add SNI support to net/smtp
b706942392
2020-09-14 17:26:36 +09:00
TOMITA Masahiro
141404e898 [ruby/net-smtp] Net::SMTP.start arguments are keyword arguments
The helo argument is not important, but the helo argument must be
specified to specify the user and secret arguments.
If helo, user, secret, and authtype arguments are keyword arguments,
it is not necessary to specify the helo argument.

269774deac
2020-09-14 17:23:41 +09:00
TOMITA Masahiro
888e04ae05 [ruby/net-smtp] TLS should not check the host name by default.
In tlsconnect(), the host name is checked when
@ssl_context.verify_mode is not OpenSSL::SSL::VERIFY_NONE, but the
verify_mode of @ssl_context generated by default is nil.

bde75a15b5
2020-09-14 17:22:35 +09:00
Hiroshi SHIBATA
8fb02b7a97
Update the license for the default gems to dual licenses 2020-08-18 20:26:39 +09:00
Hiroshi SHIBATA
0bb8bd7623
Added the missing licenses field to some default gems 2020-08-18 20:26:39 +09:00
Hiroshi SHIBATA
8f71bb0e4f
Fixed the inconsistency gemspec location with net-* gems. 2020-08-05 20:01:03 +09:00
Hiroshi SHIBATA
3ec860ae88
net-ftp is under lib/net instead of lib/net/ftp 2020-08-03 17:52:01 +09:00
Hiroshi SHIBATA
2346e2f0db
Followed up b2d96abb42 for net-ftp. 2020-08-03 17:40:05 +09:00
Nobuyoshi Nakada
b2d96abb42 Extract version number from the source
"requiring version.rb" strategy has some issues.

- cannot work when cross-compiling
- often introduces wrong namespace
- must know the superclasses
- costs at each runtime than at build-time

etc.
2020-07-30 19:03:18 +09:00
Nobuyoshi Nakada
7fb12be99f [ruby/net-ftp] Moved Net::Ftp::Version to Net::FTP
On case-insensitive filesystem, generated Net/FTP.html is
overwritten by Net/Ftp.html.

14a6ff5134
2020-07-28 15:14:01 +09:00
aycabta
c4f8095e97 Use typewriter notation for var[:sym] correctly 2020-07-27 15:24:03 +09:00
Hiroshi SHIBATA
3b3a9edf48
Drop to Ruby 2.4 2020-06-11 13:06:59 +09:00
Hiroshi SHIBATA
44581d98bb [ruby/net-imap] Drop to Ruby 2.4
c3256e3848
2020-06-11 12:39:31 +09:00
Kir Shatrov
a16fcb4205 Update docs in net/http.rb
...to reflect that Net::HTTP.start accepts keep_alive_timeout as an option.
2020-06-05 08:46:06 +09:00
Benoit Daloze
5a79d8e050 Fix error raised by Net::HTTPResponse#inflater if the block raises
* See https://bugs.ruby-lang.org/issues/13882#note-6
2020-05-31 12:48:14 +02:00
Jeremy Evans
fa380208fe Improve documentation for Net::HTTPHeader#set_form [ci skip]
Fixes [Misc #16916]
2020-05-27 13:13:46 -07:00
Shugo Maeda
5e81e8675a
Ignore exceptions when closing data connections [Bug #16780]
Patch by koshigoe (Masataka SUZUKI). Thanks!
2020-05-19 17:48:53 +09:00
Kazuhiro NISHIYAMA
1d2fc91237
Add missing , 2020-05-12 13:25:22 +09:00