Comments (2)
I'm in two minds about this. Certainly, a developer should have this option, and in fact he has because no one is required to use this project as is. Then again, good TLS settings security change over time and there are plenty of misleading optimal settings out there. I'm quite sure that the developers of aiohttp take this as seriously as we do and they can use their knowledge to provide us sane and safe TLS settings.
I guess it would be okay to add an optional keyword argument connector to the class Connection which contains a aiohttp.BaseConnector instance. But I wouldn't want to go any further. At least not without some very convincing arguments.
Nevertheless, if somebody wants to do it, the following should work (TLS settings from this page). I have not tested this and I'm definitely not recommending it!
import ssl
import aiohttp
from threema import gateway
class Connection(gateway.Connection):
def __init__(self, *args, fingerprint=None, verify_fingerprint=False, **kwargs):
super().__init__(*args, fingerprint=fingerprint,
verify_fingerprint=verify_fingerprint, **kwargs)
# Create your own SSL context here...
ssl_context = ssl.create_default_context()
# Override session
if fingerprint is None and verify_fingerprint:
fingerprint = self.fingerprint
connector = aiohttp.TCPConnector(fingerprint=fingerprint, ssl_context=ssl_context)
self._session = aiohttp.ClientSession(connector=connector)
from threema-msgapi-sdk-python.
Yes I would also only make it optional (that's why I said "ability" 😃), so that the user can choose for him/herself the best ciphers and therefore he should know that this might need to be updated at some time.
from threema-msgapi-sdk-python.
Related Issues (20)
- Improve public key pinning HOT 10
- Sign commits & releases (tags) HOT 1
- Add Travis CI
- Update fingerprint HOT 3
- Dependency pinning HOT 1
- Connection reuse HOT 10
- Codecov doesn't recognise CLI tests HOT 2
- Invalid environment marker: python_version<="3.4" HOT 9
- Inconsistent format for message IDs HOT 5
- Configurable route for callback-server CLI HOT 1
- receive messages HOT 1
- Update click package to 7.x version HOT 6
- Long standing py_lru_cache bug. HOT 2
- Allow usage of asyncio.run HOT 7
- Send ImageMessage with caption HOT 2
- Add file message based variants for images and videos
- https_proxy env is ignored
- OSError: Could not locate nacl lib HOT 1
- Get proxies information from HTTP_PROXY / HTTPS_PROXY environment variables HOT 1
- RuntimeError with aiohttp >= 3.8 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from threema-msgapi-sdk-python.