Skip to content

Commit 4284c3f

Browse files
authored
Improve remote() documentation (#2427)
* Improve remote() documentation * changelog
1 parent a366e91 commit 4284c3f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ The table below shows which release corresponds to each branch, and what date th
8686
- [#2398][2398] Add support for generating multiple shellcodes at a time in shellcraft
8787
- [#2415][2415] Add shellcraft template for IPv6 socket
8888
- [#2405][2405] Add "none" ssh authentication method
89+
- [#2427][2427] Document behaviour of remote()'s sni argument as string.
8990

9091
[2360]: https://github.com/Gallopsled/pwntools/pull/2360
9192
[2356]: https://github.com/Gallopsled/pwntools/pull/2356
@@ -101,6 +102,7 @@ The table below shows which release corresponds to each branch, and what date th
101102
[2398]: https://github.com/Gallopsled/pwntools/pull/2398
102103
[2415]: https://github.com/Gallopsled/pwntools/pull/2415
103104
[2405]: https://github.com/Gallopsled/pwntools/pull/2405
105+
[2427]: https://github.com/Gallopsled/pwntools/pull/2405
104106

105107
## 4.13.0 (`beta`)
106108

pwnlib/tubes/remote.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ class remote(sock):
2323
fam: The string "any", "ipv4" or "ipv6" or an integer to pass to :func:`socket.getaddrinfo`.
2424
typ: The string "tcp" or "udp" or an integer to pass to :func:`socket.getaddrinfo`.
2525
timeout: A positive number, None or the string "default".
26+
sock(:class:`socket.socket`): Socket to inherit, rather than connecting
2627
ssl(bool): Wrap the socket with SSL
2728
ssl_context(ssl.SSLContext): Specify SSLContext used to wrap the socket.
28-
sni: Set 'server_hostname' in ssl_args based on the host parameter.
29-
sock(socket.socket): Socket to inherit, rather than connecting
30-
ssl_args(dict): Pass ssl.wrap_socket named arguments in a dictionary.
29+
ssl_args(dict): Pass :func:`ssl.wrap_socket` named arguments in a dictionary.
30+
sni(str,bool): Set 'server_hostname' in ssl_args. Set to True to set it based on the host argument. Set to False to not provide any value. Default is True.
3131
3232
Examples:
3333
@@ -57,7 +57,7 @@ class remote(sock):
5757

5858
def __init__(self, host, port,
5959
fam = "any", typ = "tcp",
60-
ssl=False, sock=None, ssl_context=None, ssl_args=None, sni=True,
60+
sock=None, ssl=False, ssl_context=None, ssl_args=None, sni=True,
6161
*args, **kwargs):
6262
super(remote, self).__init__(*args, **kwargs)
6363

0 commit comments

Comments
 (0)