ClientTLSCertificate
-> ClientTLSKeypair
This commit is contained in:
parent
7a7af60be7
commit
29892a11d0
5 changed files with 9 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
|||
from .bot import Bot
|
||||
from .server import Server
|
||||
from .params import (ConnectionParams, ClientTLSCertificate, SASLUserPass, SASLExternal, SASLSCRAM,
|
||||
from .params import (ConnectionParams, ClientTLSKeypair, SASLUserPass, SASLExternal, SASLSCRAM,
|
||||
STSPolicy, ResumePolicy)
|
||||
from .ircv3 import Capability
|
||||
|
|
|
@ -5,7 +5,7 @@ from enum import IntEnum
|
|||
from ircstates import Server, Emit
|
||||
from irctokens import Line, Hostmask
|
||||
|
||||
from .params import ConnectionParams, SASLParams, STSPolicy, ResumePolicy, ClientTLSCertificate
|
||||
from .params import ConnectionParams, SASLParams, STSPolicy, ResumePolicy, ClientTLSKeypair
|
||||
|
||||
class ITCPReader(object):
|
||||
async def read(self, byte_count: int):
|
||||
|
@ -28,7 +28,7 @@ class ITCPTransport(object):
|
|||
port: int,
|
||||
tls: bool,
|
||||
tls_verify: bool=True,
|
||||
certificate: Optional[ClientTLSCertificate]=None,
|
||||
certificate: Optional[ClientTLSKeypair]=None,
|
||||
bindhost: Optional[str]=None
|
||||
) -> Tuple[ITCPReader, ITCPWriter]:
|
||||
pass
|
||||
|
|
|
@ -29,7 +29,7 @@ class ResumePolicy(object):
|
|||
token: str
|
||||
|
||||
@dataclass
|
||||
class ClientTLSCertificate(object):
|
||||
class ClientTLSKeypair(object):
|
||||
certfile: str
|
||||
keyfile: Optional[str] = None
|
||||
password: Optional[str] = None
|
||||
|
@ -48,7 +48,7 @@ class ConnectionParams(object):
|
|||
password: Optional[str] = None
|
||||
tls_verify: bool = True
|
||||
sasl: Optional[SASLParams] = None
|
||||
certificate: Optional[ClientTLSCertificate] = None
|
||||
certificate: Optional[ClientTLSKeypair] = None
|
||||
|
||||
sts: Optional[STSPolicy] = None
|
||||
resume: Optional[ResumePolicy] = None
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import ssl
|
||||
|
||||
from typing import Optional
|
||||
from .params import ClientTLSCertificate
|
||||
from .params import ClientTLSKeypair
|
||||
|
||||
def tls_context(
|
||||
verify: bool=True,
|
||||
certificate: Optional[ClientTLSCertificate]=None
|
||||
certificate: Optional[ClientTLSKeypair]=None
|
||||
) -> ssl.SSLContext:
|
||||
|
||||
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
|
||||
|
|
|
@ -4,7 +4,7 @@ from asyncio import StreamReader, StreamWriter
|
|||
from async_stagger import open_connection
|
||||
|
||||
from .interface import ITCPTransport, ITCPReader, ITCPWriter
|
||||
from .params import ClientTLSCertificate
|
||||
from .params import ClientTLSKeypair
|
||||
from .security import tls_context
|
||||
|
||||
class TCPReader(ITCPReader):
|
||||
|
@ -37,7 +37,7 @@ class TCPTransport(ITCPTransport):
|
|||
port: int,
|
||||
tls: bool,
|
||||
tls_verify: bool=True,
|
||||
certificate: Optional[ClientTLSCertificate]=None,
|
||||
certificate: Optional[ClientTLSKeypair]=None,
|
||||
bindhost: Optional[str]=None
|
||||
) -> Tuple[ITCPReader, ITCPWriter]:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue