Граф коммитов

892 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA c53bdb8ff6
Removed dependency of net-protocol. There is no plan to remove from stdlib 2022-02-21 17:10:56 +09:00
Hiroshi SHIBATA 79b04790e8
Removed dependency of io-wait. There is no plan to remove from stdlib 2022-02-21 17:10:22 +09:00
Jeremy Evans 7529c53891 [ruby/net-http] Do not set SNI hostname if connecting to IP address
RFC 6066, section 3, explicitly disallows the use of an IP address
as an SNI server name.  So check if the connection is being made
to an IP address using the resolv regexps, and do not set an SNI
hostname in that case.

Recent changes to LibreSSL make it more strictly follow RFC 6066,
resulting an s.hostname= raising an error if passed an IP address.
When such verions of LibreSSL are used, this change not only fixes
the net/http tests, it also fixes tests for webrick and open-uri,
which both make SSL connections to 127.0.0.1 using net/http in
their tests.

Avoid warning in the openssl extension by unsetting
@ssl_context.verify_hostname if connecting to an IP address.
Make changes so that the post_connection_check still happens
when connecting to an IP address, which is necessary to keep
checking that the certificate returned includes the IP address,
which one of the tests depends on.

Revert the previous change that modified the regexp used for
checking the error message.

https://github.com/ruby/net-http/commit/fa68e64bee
2022-02-03 05:10:21 +09:00
Olle Jonsson d8c54bac4a [ruby/net-protocol] Fix typo in gem description [ci skip]
https://github.com/ruby/net-protocol/commit/35d7b08a54
2022-02-02 21:21:47 +09:00
Olle Jonsson 94687a6826 [ruby/net-protocol] Drop unused gemspec directives
This gem exposes no executables.

https://github.com/ruby/net-protocol/commit/3c4def2a64
2022-02-02 21:17:47 +09:00
Brandon Weaver ac1bb6b510 [ruby/net-http] Rename `D` to `debug` in `Net::HTTP`
Renames `D` to `debug` in `Net::HTTP` and introduces an alias for
backwards compatibility. This was done for readability reasons, in that
`D` did not clearly reflect what the method was doing and can cause some
confusion.

https://github.com/ruby/net-http/commit/582d6e87d6
2022-01-17 10:17:23 +09:00
Kazuhiro NISHIYAMA 5757696e07
`res.response_body_permitted?` is not defined
`response_body_permitted?` is a method of request.
2022-01-05 16:20:11 +09:00
Olle Jonsson c240ccd643 [ruby/net-http] gemspec: Drop unused directive "executables"
This gem exposes no executable files.

https://github.com/ruby/net-http/commit/3b3743f6ce
2021-11-17 19:09:14 +09:00
Nobuyoshi Nakada 5bff4cd56c [ruby/net-protocol] Update the required ruby version
https://github.com/ruby/net-protocol/commit/d4982420e6
2021-11-16 20:56:04 +09:00
Shohei Maeda 52ab9bbee9 [ruby/net-http] Send Accept-Encoding header on HEAD method
https://github.com/ruby/net-http/commit/9d95c5e3e6
2021-11-11 17:34:00 +09:00
Nobuyoshi Nakada 3d8e1ee40f [ruby/net-http] Warn deprecated old constants
https://github.com/ruby/net-http/commit/2a97b4729b
2021-11-04 20:51:51 +09:00
Nobuyoshi Nakada b49dbe025f [ruby/net-http] Fix the typo in a constant name
https://github.com/ruby/net-http/commit/dada6007bf
2021-11-04 20:51:42 +09:00
Kazuki Yamaguchi 5f2c4e344d [ruby/net-http] Reset keep_alive timer on new connection
The last_communicated timestamp is for HTTP persistent connection, to
decide whether the current TCP connection may be reused for the
subsequent requests or not. Naturally, the timer must be reset if the
connection is recreated since it is no longer relevant.

https://github.com/ruby/net-http/commit/0a013de42d
2021-11-04 20:44:04 +09:00
180909 6c812c6f4e add missing http response code in doc 2021-10-30 10:16:17 +09:00
Hiroshi SHIBATA cb4c98f949 [ruby/net-http] Bump up net-http version to 0.2.0
https://github.com/ruby/net-http/commit/f3e65e2a31
2021-10-21 21:01:06 +09:00
Hiroshi SHIBATA cc2f76041d [ruby/net-protocol] Bump up net-protocol version to 0.1.2
https://github.com/ruby/net-protocol/commit/088e52609a
2021-10-21 21:00:53 +09:00
Miguel Teixeira 60b02db516 [ruby/net-http] Enforce write timeout when body_stream is used
The existing implementation of `Net::HTTP#write_timeout` relies on
`Net::BefferedIO` to trigger the `Net::WriteTimeout` error. This commit
changes `send_request_with_body_stream` to remove the optimization that
was making `Net::HTTP#write_timeout` not work when `body_stream` is
used.

Open issue:
https://bugs.ruby-lang.org/issues/17933

https://github.com/ruby/net-http/commit/a0fab1ab52
2021-07-29 15:53:54 +09:00
Nobuyoshi Nakada 2b17d2f297 [ruby/net-protocol] Get rid of `__send__`
Mitigate the security risk:
https://devcraft.io/2021/01/07/universal-deserialisation-gadget-for-ruby-2-x-3-x.html

https://github.com/ruby/net-protocol/commit/a9970437e8
2021-06-16 22:23:46 +09:00
Hiroshi SHIBATA cd2190448d
[ruby/net-protocol] Bump version to 0.1.1
https://github.com/ruby/net-protocol/commit/97c4b68528
2021-05-31 17:40:07 +09:00
Hiroshi SHIBATA be2e2b4805 Promote net-smtp to the bundled gems 2021-05-27 14:42:11 +09:00
Hiroshi SHIBATA aa9726f7b9 Promote net-pop to the bundled gems 2021-05-27 14:42:11 +09:00
Hiroshi SHIBATA d5bc6b2337 Promote net-imap to the bundled gems 2021-05-27 14:42:11 +09:00
Hiroshi SHIBATA e49c998d1e Promote net-ftp to the bundled gems 2021-05-27 14:42:11 +09:00
Shugo Maeda 773c690f25 [ruby/net-ftp] Bump version to 0.1.2
https://github.com/ruby/net-ftp/commit/895ba44b3c
2021-05-12 09:20:41 +09:00
Kazuki Yamaguchi 364044e090 [ruby/net-http] Do not require stringio
It is not used in net/http library code since commit 15ccd0118c13
(r36473 in ruby svn trunk, 2012).

require's in test suite are also cleaned up.

https://github.com/ruby/net-http/commit/996d18a43f
2021-05-06 15:58:41 +09:00
Hiroshi SHIBATA 965719f5eb
Fixed the file path for net-imap.gemspec 2021-05-06 15:24:49 +09:00
Hiroshi SHIBATA 5de6f1ab47
Move net-imap.gemspec to under the lib/net/imap directory. 2021-05-06 15:20:35 +09:00
nicholas a. evans 5a02281fab
[ruby/net-imap] Many documentation improvements
* updated obsoleted RFCs to current versions
* linked most references to their RFCs
* linked extension commands to their RFCs
* removed unidiomatic `()` from instance method links
* escaped `IMAP` in a few places
* converted all response structs to explicit classes: this makes much
  nicer rdoc output than listing them all under "constants"
* grouped flags constants into their own sections

https://github.com/ruby/net-imap/commit/9cd562ac84
2021-05-06 15:20:35 +09:00
nicholas a. evans b0de2e7fe9
[ruby/net-imap] Move send_*_data into net/imap/command_data
Partially implements #10.

https://github.com/ruby/net-imap/commit/64d1080d63
2021-05-06 15:20:35 +09:00
nicholas a. evans deae61e939
[ruby/net-imap] Move flags to net/imap/flags
Partially implements #10.

https://github.com/ruby/net-imap/commit/2a9afa83bf
2021-05-06 15:20:34 +09:00
nicholas a. evans 337c0e312b
[ruby/net-imap] Move UTF7 & datetime formatting to net/imap/data_encoding
Partially implements #10.

https://github.com/ruby/net-imap/commit/0d43c5e856
2021-05-06 15:20:34 +09:00
nicholas a. evans 4dc7b82427
[ruby/net-imap] move command data formatters to net/imap/command_data
Partially implements #10.

https://github.com/ruby/net-imap/commit/24e929fdd2
2021-05-06 15:20:34 +09:00
nicholas a. evans affb51045c
[ruby/net-imap] move response data structs to net/imap/response_data
Partially implements #10.

https://github.com/ruby/net-imap/commit/746757b936
2021-05-06 15:20:34 +09:00
nicholas a. evans 395a287736
[ruby/net-imap] move ResponseParser to lib/net/imap/response_parser
Partially implements #10.

https://github.com/ruby/net-imap/commit/c2408aac9a
2021-05-06 15:20:34 +09:00
nicholas a. evans 2fc91da86c
[ruby/net-imap] Clean up authenticators rdoc
Added RFC links to all SASL mechanism specifications.

https://github.com/ruby/net-imap/commit/53ff4b0c09
2021-05-06 15:20:34 +09:00
nicholas a. evans 912f39b2c3
[ruby/net-imap] Update AUTH=PLAIN to be a little closer to RFC4616
* Add authzid support
* must not contain NULL chars
* improve rdoc

https://github.com/ruby/net-imap/commit/a587fc71b7
2021-05-06 15:20:34 +09:00
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.

https://github.com/ruby/net-imap/commit/23f241b081
2021-05-06 15:20:33 +09:00
Ryuta Kamizono 908785ef6d [ruby/net-imap] Fix typo intentionaly -> intentionally [ci skip]
https://github.com/ruby/net-imap/commit/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

https://github.com/ruby/net-http/commit/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 https://github.com/ruby/ruby/commit/c1652035644

`/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.

https://github.com/ruby/net-http/commit/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

https://github.com/ruby/net-http/commit/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

https://github.com/ruby/net-http/commit/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
https://github.com/ruby/net-smtp/commit/8f2c9323e2
2021-04-28 10:51:10 +09:00
Hiroshi SHIBATA eebecdf1c4 [ruby/net-smtp] Removed needless files from Gem::Specification#files
https://github.com/ruby/net-smtp/commit/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

https://github.com/ruby/net-smtp/commit/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 })`.

https://github.com/ruby/net-smtp/commit/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.

https://github.com/ruby/net-ftp/commit/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.

https://github.com/ruby/net-ftp/commit/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

https://github.com/ruby/net-ftp/commit/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).

https://github.com/ruby/net-ftp/commit/d65910132f
2021-04-27 21:20:48 +09:00