vesoft-inc / nebula-python

Client API of Nebula Graph in Python
194 stars 76 forks source link

SNI support: SSL_set_tlsext_host_name #238

Closed wey-gu closed 1 year ago

wey-gu commented 1 year ago

SSL_set_tlsext_host_name is the openssl function to add SNI, which is needed in TLSv1.3.

ref:

codecov-commenter commented 1 year ago

Codecov Report

Base: 27.31% // Head: 77.46% // Increases project coverage by +50.14% :tada:

Coverage data is based on head (10f731c) compared to base (2c64858). Patch has no changes to coverable lines.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #238 +/- ## =========================================== + Coverage 27.31% 77.46% +50.14% =========================================== Files 75 17 -58 Lines 61746 2405 -59341 =========================================== - Hits 16868 1863 -15005 + Misses 44878 542 -44336 ``` | [Impacted Files](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc) | Coverage Δ | | |---|---|---| | [nebula3/fbthrift/transport/TSSLSocket.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9mYnRocmlmdC90cmFuc3BvcnQvVFNTTFNvY2tldC5weQ==) | | | | [nebula3/fbthrift/util/BytesStrIO.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9mYnRocmlmdC91dGlsL0J5dGVzU3RySU8ucHk=) | | | | [nebula3/storage/constants.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9zdG9yYWdlL2NvbnN0YW50cy5weQ==) | | | | [nebula3/fbthrift/protocol/TProtocolDecorator.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9mYnRocmlmdC9wcm90b2NvbC9UUHJvdG9jb2xEZWNvcmF0b3IucHk=) | | | | [...ebula3/fbthrift/transport/TSocketOverHttpTunnel.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9mYnRocmlmdC90cmFuc3BvcnQvVFNvY2tldE92ZXJIdHRwVHVubmVsLnB5) | | | | [nebula3/fbthrift/protocol/TBinaryProtocol.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9mYnRocmlmdC9wcm90b2NvbC9UQmluYXJ5UHJvdG9jb2wucHk=) | | | | [nebula3/fbthrift/util/inspect.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9mYnRocmlmdC91dGlsL2luc3BlY3QucHk=) | | | | [nebula3/fbthrift/util/TValidator.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9mYnRocmlmdC91dGlsL1RWYWxpZGF0b3IucHk=) | | | | [nebula3/fbthrift/util/TCppServerTestManager.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9mYnRocmlmdC91dGlsL1RDcHBTZXJ2ZXJUZXN0TWFuYWdlci5weQ==) | | | | [nebula3/meta/ttypes.py](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc#diff-bmVidWxhMy9tZXRhL3R0eXBlcy5weQ==) | | | | ... and [48 more](https://codecov.io/gh/vesoft-inc/nebula-python/pull/238/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vesoft-inc)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

wey-gu commented 1 year ago

@Aiee not sure if this file is generated or manually composed, this change is needed or it cannot support TLSv1.3(SNI).

Aiee commented 1 year ago

@Aiee not sure if this file is generated or manually composed, this change is needed or it cannot support TLSv1.3(SNI).

The files under the fbthrift dir are just a python library. You can find the upstream here https://github.com/facebook/fbthrift/tree/main/thrift/lib/py

From https://github.com/facebook/fbthrift/blob/main/thrift/lib/py/transport/TSSLSocket.py it seems fbthrift hasn't supported TLSv1.3 yet, and I'm not sure if it is a good idea to hack the library like this.

Sophie-Xie commented 1 year ago

It's too long. I'll close it and reopen if necessary.