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

824 Коммитов

Автор SHA1 Сообщение Дата
nicholas a. evans f1d32010e6 [ruby/net-smtp] Add SNI support to net/smtp
https://github.com/ruby/net-smtp/commit/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.

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

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

https://github.com/ruby/net-ftp/commit/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
https://github.com/ruby/net-imap/commit/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
Stephen Touset 31af0dafba Expose SSLContext#extra_chain_cert in Net::HTTP
Currently, Net::HTTP can only send a single SSL certificate when it
establishes a connection. Some use-cases involve sending an entire
certificate chain to the destination; for this, SSLContext supports
assigning to #extra_chain_cert=.

This adds support in Net::HTTP for exposing this underlying SSLContext
property to end-users. [Feature #9758]
2020-05-12 12:55:04 +09:00
Hiroshi SHIBATA ba3b99b96a
The current net-http is only works with Ruby 2.6+ 2020-04-08 15:59:55 +09:00
Kazuhiro NISHIYAMA de10631dcf
Add workaround for test-bundler failure
https://github.com/ruby/actions/runs/500526558?check_suite_focus=true#step:16:127
```
Failures:

  1) Bundler.setup when Bundler is bundled doesn't blow up
     Failure/Error: expect(err).to be_empty

       expected `"fatal: not a git repository (or any of the parent directories): .git\nfatal: not a git repository (o...the parent directories): .git\nfatal: not a git repository (or any of the parent directories): .git".empty?` to return true, got false

       Commands:
       $ /home/runner/work/actions/actions/snapshot-master/ruby \
         -I/home/runner/work/actions/actions/snapshot-master/lib:/home/runner/work/actions/actions/snapshot-master/spec/bundler \
         -rsupport/hax -rsupport/artifice/fail \
         /home/runner/work/actions/actions/snapshot-master/libexec/bundle install --retry 0
       Resolving dependencies...
       Using bundler 2.1.4
       Bundle complete! 1 Gemfile dependency, 1 gem now installed.
       Use `bundle info [gemname]` to see where a bundled gem is installed.
       fatal: not a git repository (or any of the parent directories): .git
       fatal: not a git repository (or any of the parent directories): .git
       fatal: not a git repository (or any of the parent directories): .git
       # $? => 0

       $ /home/runner/work/actions/actions/snapshot-master/ruby \
         -I/home/runner/work/actions/actions/snapshot-master/lib:/home/runner/work/actions/actions/snapshot-master/spec/bundler \
         -rsupport/hax -rsupport/artifice/fail \
         /home/runner/work/actions/actions/snapshot-master/libexec/bundle exec ruby -e \
         require\ \'bundler\'\;\ Bundler.setup
       fatal: not a git repository (or any of the parent directories): .git
       fatal: not a git repository (or any of the parent directories): .git
       fatal: not a git repository (or any of the parent directories): .git
       # $? => 0
     # ./spec/bundler/runtime/setup_spec.rb:1056:in `block (3 levels) in <top (required)>'
     # ./spec/bundler/spec_helper.rb:111:in `block (3 levels) in <top (required)>'
     # ./spec/bundler/spec_helper.rb:111:in `block (2 levels) in <top (required)>'
     # ./spec/bundler/spec_helper.rb:78:in `block (2 levels) in <top (required)>'
make: *** [yes-test-bundler] Error 1
```
2020-03-12 19:17:08 +09:00
Takashi Kokubun da6948753e
Fix an example committed to a wrong place [ci skip] 2020-03-10 22:36:48 -07:00
Takashi Kokubun e0512b29aa
Let Net::HTTP.get take request headers (#2957)
* Let Net::HTTP.get take request headers

* Add more test cases for no header usages

* Add examples with request headers

* Add a NEWS entry [ci skip]

[Feature #16686]
2020-03-10 22:26:22 -07:00
Nobuyoshi Nakada 2b7409a2f2
Specify explicit separator not to be affected by $; 2020-03-08 17:38:37 +09:00
Nobuyoshi Nakada 108f7536b3
Removed unnecessary `chomp`
As `String#split` with the default argument drops trailing newline
as a separator, preceding `String#chomp` is futile.
2020-03-07 17:04:37 +09:00
Hiroshi SHIBATA e7f8724fb2
Fixed net-ftp sync task and resync from standalone repo 2020-02-21 21:25:43 +09:00
Hiroshi SHIBATA 9cb1ffaa5c
Promote net-http to the default gems.
test/net/http/test_https.rb: rename fixture methods to read_fixture
  because it conflicts with test-unit gem.
2020-02-21 21:21:14 +09:00
Hiroshi SHIBATA f08d8e5e85
Promote net-ftp to default gems 2020-02-21 19:09:21 +09:00
Hiroshi SHIBATA 3e12b65861
Fallback to load version file in ruby core repository 2020-02-20 21:32:27 +09:00
Hiroshi SHIBATA e9d872a06e
Promote net-imap to the default gems 2020-02-20 21:24:19 +09:00
git 9239226e39 * append newline at EOF. [ci skip] 2020-02-17 22:16:32 +09:00
Hiroshi SHIBATA 0ae9780352
Promote net-protocol to default gems 2020-02-17 22:15:20 +09:00
Nobuyoshi Nakada e6334fd450
Unnamed groups are not captured when named groups are used 2020-01-30 12:05:18 +09:00
Yuta Iwama be6931f7f7 Add #verify_hostname= and #verify_hostname to skip hostname verification (#2858)
According to https://github.com/ruby/openssl/pull/60,

> Currently an user who wants to do the hostname verification needs to
call SSLSocket#post_connection_check explicitly after the TLS connection
is established.

if an user who wants to skip the hostname verification,
SSLSocket#post_connection_check doesn't need to be called

https://bugs.ruby-lang.org/issues/16555
2020-01-23 17:23:17 +09:00
Yusuke Endoh 65c2c75e16 lib/net/imap.rb: use `&blk` instead of Kernel#proc with no block
[Bug #16488]
2020-01-09 08:21:42 +09:00
Nobuyoshi Nakada e68999c82c
Fixed misspellings
Fixed misspellings reported at [Bug #16437], for default gems.
2019-12-20 12:19:45 +09:00
Kazuhiro NISHIYAMA 299db37957 Use while instead of loop 2019-12-17 21:56:09 +09:00
NARUSE, Yui 5be34d6a33 ensure to close the data connection [Bug #16413] 2019-12-17 08:24:47 +09:00
Yusuke Endoh 251f5d8226 Revert "lib/net/http/response.rb: support raw deflate correctly"
This reverts commit 5105240b1e.

In RFC 2616:

```
   deflate
        The "zlib" format defined in RFC 1950 [31] in combination with
        the "deflate" compression mechanism described in RFC 1951 [29].
```

So "Content-Encoding: deflate" means zlib format, not raw deflate.

[Bug #11268]
2019-12-16 23:39:10 +09:00
Yusuke Endoh 5105240b1e lib/net/http/response.rb: support raw deflate correctly
Net::HTTP had used `Zlib::Inflate.new(32 + Zlib::MAX_WBITS)` for all
content encoding (deflate, zlib, and gzip).
But the argument `32 + Zlib::MAX_WBITS` means zlib and gzip decoding
with automatic header detection, so (raw) deflate compression had not
been supported.

This change makes it support raw deflate correctly by passing an
argument `-Zlib::MAX_WBITS` (which means raw deflate) to
`Zlib::Inflate.new`.  All deflate-mode tests are fixed too.

[Bug #11268]
2019-12-16 23:20:42 +09:00
NARUSE, Yui af11efd377 fix ipaddr parameter of Net::HTTP.start to support proxy
54072e329c
2019-12-10 19:12:21 +09:00
Yusuke Endoh 3ca3c8d768 lib/net/http.rb: align the indentation 2019-12-10 14:15:35 +09:00
NARUSE, Yui c2dc27d643 fix typo of 54072e329c 2019-12-09 20:48:35 +09:00
NARUSE, Yui 54072e329c Add ipaddr optional parameter to Net::HTTP#start
to replace the address for TCP/IP connection [Feature #5180]

There're 3 layers of hostname:
* host address for TCP/IP
* TLS server name
* HTTP Host header value
To test DNS round robin or check server certificate from server local,
people sometimes want to connect server with given IP address but keep
TLS server name and HTTP Host header value.

closes [Feature #15215]
closes https://github.com/ruby/ruby/pull/1893
closes https://github.com/ruby/ruby/pull/1977
2019-12-09 20:21:49 +09:00
Jeremy Evans ffd0820ab3 Deprecate taint/trust and related methods, and make the methods no-ops
This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
2019-11-18 01:00:25 +02:00
Jeremy Evans c5c05460ac Warn on access/modify of $SAFE, and remove effects of modifying $SAFE
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.

This modifies some internal functions that took a safe level argument
to no longer take the argument.

rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.

One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd.  We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
2019-11-18 01:00:25 +02:00
Kazuhiro NISHIYAMA 6744593b8c
Fix a typo [ci skip] 2019-11-15 11:01:06 +09:00
Hiroshi SHIBATA 3c252651e1
Fixed test failure related Net::Protocol 2019-11-07 17:09:22 +09:00
Hiroshi SHIBATA c916f9600b
SMTP is not module 2019-11-07 16:44:38 +09:00
Hiroshi SHIBATA 223d3c460a
Promote net-smtp to default gems 2019-11-07 16:36:14 +09:00