nslookupot 0.0.3 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78b5138121e6546a6dbb0bafd8598089a9c2d5d7d483acb06d2a813eb82087fa
4
- data.tar.gz: a594f974a3530a3853db065572b8cb7348f15d7271a8dd6d37c00df0d9dbc9a5
3
+ metadata.gz: 6d0cd401150ed1287584d18e88c6f694832c815a457bc3009e8f81a8dec31b32
4
+ data.tar.gz: 8052893c2bc633f31507e48c164d8fd40e31d271e9d18cd79996615acb35fc2d
5
5
  SHA512:
6
- metadata.gz: 027d8c572281ac6932f57568973a1180756e4bcca4f6fa2a7581073a05dfcc408e68102dbebf339fbb5e3e4d6e51db82694f46c375cf203a8224184895deb69c
7
- data.tar.gz: 58fa8a50615b82c6515e1acfdb58976807e86e9114102398f27c567d6e9305e76eca664bc6ae7ed2f56b84a1ef9e599bd8408996863fe6c63a72734bfb8ef934
6
+ metadata.gz: f74d383dc494c2bf4c431e1efb05cde628d2643fb1e92d3575a6f463b78486e1557e706044f18127346299107d55dd68c15f145dcf473229853bb81743d43e67
7
+ data.tar.gz: 1a1a138a511184c23d7b19e1eee57ec48a5a8f347a13f2d002aed9f74d734ede131d00f300c3d512b70345cf153333e7d5b4c8556ce8640179008f03194c8241
@@ -0,0 +1,29 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - '*'
10
+
11
+ jobs:
12
+ ci:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ ruby-version: ['2.6.x', '2.7.x']
17
+ steps:
18
+ - name: Set up Ruby
19
+ uses: actions/setup-ruby@v1
20
+ - uses: actions/checkout@v1
21
+ - name: Install dependencies
22
+ run: |
23
+ gem --version
24
+ gem install bundler
25
+ bundle --version
26
+ bundle install
27
+ - name: Run test
28
+ run: |
29
+ bundle exec rake
data/Gemfile CHANGED
@@ -5,10 +5,10 @@ source 'https://rubygems.org'
5
5
  gem 'caa_rr_patch'
6
6
  gem 'openssl'
7
7
  gem 'rake'
8
+ gem 'svcb_rr_patch'
8
9
 
9
10
  group :test do
10
- gem 'pry'
11
- gem 'pry-byebug'
11
+ gem 'byebug'
12
12
  gem 'rspec', '3.8.0'
13
13
  gem 'rubocop', '0.78.0'
14
14
  end
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # nslookupot
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/nslookupot.svg)](https://badge.fury.io/rb/nslookupot)
4
- [![Build Status](https://travis-ci.org/thekuwayama/nslookupot.svg?branch=master)](https://travis-ci.org/thekuwayama/nslookupot)
4
+ [![CI](https://github.com/thekuwayama/nslookupot/workflows/CI/badge.svg)](https://github.com/thekuwayama/nslookupot/actions?workflow=CI)
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/5df9157757f5a0bf1623/maintainability)](https://codeclimate.com/github/thekuwayama/nslookupot/maintainability)
6
6
 
7
7
  nslookupot is CLI that is `nslookup` over TLS (version 1.2).
@@ -24,6 +24,7 @@ Usage: nslookupot [options] name
24
24
  -s, --server VALUE the name server IP address (default 1.1.1.1)
25
25
  -p, --port VALUE the name server port number (default 853)
26
26
  -h, --hostname VALUE the name server hostname (default cloudflare-dns.com)
27
+ -n, --no-check-sni no check SNI (default false)
27
28
  -t, --type VALUE the type of the information query (default A)
28
29
  ```
29
30
 
data/lib/nslookupot.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'caa_rr_patch'
4
3
  require 'resolv'
4
+ require 'caa_rr_patch'
5
+ require 'svcb_rr_patch'
5
6
  require 'socket'
6
7
  require 'openssl'
7
8
  require 'optparse'
@@ -12,7 +12,8 @@ module Nslookupot
12
12
  opts = {
13
13
  server: '1.1.1.1',
14
14
  port: 853,
15
- hostname: 'cloudflare-dns.com'
15
+ hostname: 'cloudflare-dns.com',
16
+ check_sni: true
16
17
  }
17
18
  type = 'A'
18
19
 
@@ -40,6 +41,14 @@ module Nslookupot
40
41
  opts[:hostname] = v
41
42
  end
42
43
 
44
+ op.on(
45
+ '-n',
46
+ '--no-check-sni',
47
+ "no check SNI (default #{!opts[:check_sni]})"
48
+ ) do
49
+ opts[:check_sni] = false
50
+ end
51
+
43
52
  op.on(
44
53
  '-t',
45
54
  '--type VALUE',
@@ -5,11 +5,17 @@ module Nslookupot
5
5
  # @param server [String]
6
6
  # @param port [Integer]
7
7
  # @param hostname [String]
8
- def initialize(server: '1.1.1.1', port: 853,
9
- hostname: 'cloudflare-dns.com')
8
+ # @param check_sni [bool]
9
+ def initialize(
10
+ server: '1.1.1.1',
11
+ port: 853,
12
+ hostname: 'cloudflare-dns.com',
13
+ check_sni: true
14
+ )
10
15
  @server = server
11
16
  @port = port
12
17
  @hostname = hostname # for SNI
18
+ @check_sni = check_sni
13
19
  end
14
20
 
15
21
  # @param name [String]
@@ -70,10 +76,16 @@ module Nslookupot
70
76
  def gen_sock
71
77
  ts = TCPSocket.new(@server, @port)
72
78
  ctx = OpenSSL::SSL::SSLContext.new('TLSv1_2')
79
+ ctx.alpn_protocols = ['dot']
73
80
  sock = OpenSSL::SSL::SSLSocket.new(ts, ctx)
74
81
  sock.sync_close = true
75
- sock.connect
76
- sock.post_connection_check(@hostname)
82
+ if @check_sni
83
+ sock.hostname = @hostname
84
+ sock.connect
85
+ sock.post_connection_check(@hostname)
86
+ else
87
+ sock.connect
88
+ end
77
89
 
78
90
  sock
79
91
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nslookupot
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.7'
5
5
  end
data/nslookupot.gemspec CHANGED
@@ -22,5 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = ['nslookupot']
23
23
 
24
24
  spec.add_development_dependency 'bundler'
25
+ spec.add_dependency 'caa_rr_patch'
25
26
  spec.add_dependency 'openssl'
26
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nslookupot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekuwayama
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-28 00:00:00.000000000 Z
11
+ date: 2021-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: caa_rr_patch
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: openssl
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -46,9 +60,9 @@ executables:
46
60
  extensions: []
47
61
  extra_rdoc_files: []
48
62
  files:
63
+ - ".github/workflows/ci.yml"
49
64
  - ".gitignore"
50
65
  - ".rubocop.yml"
51
- - ".travis.yml"
52
66
  - Gemfile
53
67
  - LICENSE.txt
54
68
  - README.md
@@ -66,7 +80,7 @@ homepage: https://github.com/thekuwayama/nslookupot
66
80
  licenses:
67
81
  - MIT
68
82
  metadata: {}
69
- post_install_message:
83
+ post_install_message:
70
84
  rdoc_options: []
71
85
  require_paths:
72
86
  - lib
@@ -81,8 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
97
  requirements: []
84
- rubygems_version: 3.1.2
85
- signing_key:
98
+ rubygems_version: 3.2.3
99
+ signing_key:
86
100
  specification_version: 4
87
101
  summary: nslookup over TLS
88
102
  test_files:
data/.travis.yml DELETED
@@ -1,16 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - 2.6
5
- - 2.7
6
- - ruby-head
7
-
8
- matrix:
9
- allow_failures:
10
- - rvm: ruby-head
11
-
12
- before_install:
13
- - gem install bundler
14
- - bundle install
15
-
16
- script: bundle exec rake