4 Commits

2 changed files with 22 additions and 7 deletions
Split View
  1. +16
    -5
      README.md
  2. +6
    -2
      ntunnel/__init__.py

+ 16
- 5
README.md View File

@@ -88,23 +88,23 @@ ntunnel quic_serv -k example.key -c example.crt udp:192.0.2.5:12322 tcp:127.0.0.

Run client:
```
ntunnel quic_client --ca-certs funkthat.crt tcp:127.0.0.1:42720 udp:192.0.2.5:12322
ntunnel quic_client --ca-certs example.crt tcp:127.0.0.1:42720 udp:192.0.2.5:12322
```

Running Tests
-------------

Currently ntunnel requires Python 3.7 or later. If the default
virtualenv is not 3.7 or later, you can set the VIRTUALENV variable to specify
Currently ntunnel requires Python 3.10 or later. If the default
virtualenv is not 3.10 or later, you can set the VIRTUALENV variable to specify
which one to use, such as:
```
make env VIRTUALENV=virtualenv-3.7
make env VIRTUALENV=virtualenv-3.10
```

If you want to use an alternate version of python, you can specify
VIRTUALENVARGS, such as:
```
make env VIRTUALENV=virtualenv-3.7 VIRTUALENVARGS="-p $(which pypy3)"
make env VIRTUALENV=virtualenv-3.10 VIRTUALENVARGS="-p $(which pypy3)"
```

Once you have the environment setup, you can source the development
@@ -141,6 +141,17 @@ Known Issues
- Possible memory leak for each connection
Error message is: Task exception was never retrieved
See the commented out assertion at the end of test_clientkeymismatch
- cryptography may install broken. If you get the error message:
```
RuntimeError: OpenSSL 3.0's legacy provider failed to load. This is a fatal error by default, but cryptography supports running without legacy algorithms by setting the environment variable CRYPTOGRAPHY_OPENSSL_NO_LEGACY. If you did not expect this error, you have likely made a mistake with your OpenSSL configuration.
```
Run the following:
```
pip uninstall cryptography
export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1
pip install cryptography
```
and try again.

TODO/Future Features
--------------------


+ 6
- 2
ntunnel/__init__.py View File

@@ -38,6 +38,7 @@ from noise.connection import NoiseConnection, Keypair
import argparse
import asyncio
import base64
import functools
import os.path
import shutil
import socket
@@ -250,7 +251,9 @@ def parsesockstr(sockstr):
return proto, args

async def connectsockstr(sockstr):
'''Wrapper for asyncio.open_*_connection.'''
'''Wrapper for asyncio.open_*_connection.

For the format of sockstr, please see parsesockstr.'''

proto, args = parsesockstr(sockstr)

@@ -264,7 +267,7 @@ async def connectsockstr(sockstr):
return reader, writer

async def listensockstr(sockstr, cb):
'''Wrapper for asyncio.start_x_server.
'''Wrapper for asyncio.start_*_server.

For the format of sockstr, please see parsesockstr.

@@ -505,6 +508,7 @@ async def NoiseForwarder(mode, encrdrwrr, connvalid, priv_key, pub_key=None):
# Slightly modified to timeout and to print trace back when canceled.
# This makes it easier to figure out what "froze".
def async_test(f):
@functools.wraps(f)
def wrapper(*args, **kwargs):
async def tbcapture():
try:


Loading…
Cancel
Save