Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
DNS testing tools
Remoh
Commits
d0836940
Commit
d0836940
authored
Sep 10, 2020
by
Alexandre
Browse files
Remove hard coded DoT and DoH port values
parent
7e72380f
Changes
3
Hide whitespace changes
Inline
Side-by-side
homer.py
View file @
d0836940
...
...
@@ -638,12 +638,12 @@ if not opts.check or opts.connectTo is not None:
ip_set
=
{
opts
.
connectTo
,
}
else
:
if
opts
.
dot
:
port
=
853
port
=
homer
.
PORT_DOT
if
not
homer
.
is_valid_hostname
(
url
):
error
(
"DoT requires a host name or IP address, not
\"
%s
\"
"
%
url
)
netloc
=
url
else
:
port
=
443
port
=
homer
.
PORT_DOH
if
not
homer
.
is_valid_url
(
url
):
error
(
"DoH requires a valid HTTPS URL, not
\"
%s
\"
"
%
url
)
try
:
...
...
homer/__init__.py
View file @
d0836940
...
...
@@ -27,6 +27,9 @@ from .exceptions import RequestDOTException
from
.exceptions
import
PipeliningException
from
.exceptions
import
DOHException
PORT_DOT
=
853
PORT_DOH
=
443
TIMEOUT_CONN
=
2
TIMEOUT_READ
=
1
SLEEP_TIMEOUT
=
0.5
...
...
homer/connection.py
View file @
d0836940
...
...
@@ -105,7 +105,7 @@ class ConnectionDOT(Connection):
addr
=
self
.
server
# otherwise keep the server name
family
=
homer
.
get_addrfamily
(
addr
,
forceIPv4
=
self
.
forceIPv4
,
forceIPv6
=
self
.
forceIPv6
)
addrinfo_list
=
socket
.
getaddrinfo
(
addr
,
853
,
family
)
addrinfo_list
=
socket
.
getaddrinfo
(
addr
,
homer
.
PORT_DOT
,
family
)
addrinfo_set
=
{
(
addrinfo
[
4
],
addrinfo
[
0
])
for
addrinfo
in
addrinfo_list
}
signal
.
signal
(
signal
.
SIGALRM
,
homer
.
exceptions
.
timeout_connection
)
...
...
@@ -336,7 +336,7 @@ def create_handle(connection):
if
connection
.
forceIPv6
:
handle
.
setopt
(
pycurl
.
IPRESOLVE
,
pycurl
.
IPRESOLVE_V6
)
if
connection
.
connect_to
is
not
None
:
handle
.
setopt
(
pycurl
.
CONNECT_TO
,
[
"::[%s]:
443
"
%
connection
.
connect_to
,])
handle
.
setopt
(
pycurl
.
CONNECT_TO
,
[
"::[%s]:
%d
"
%
(
connection
.
connect_to
,
homer
.
PORT_DOH
),
])
handle
.
setopt
(
pycurl
.
HTTPHEADER
,
[
"Accept: application/dns-message"
,
"Content-type: application/dns-message"
])
handle
.
reset_opt_default
=
reset_opt_default
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment