mindflayer / python-mocket

a socket mock framework - for all kinds of socket animals, web-clients included
BSD 3-Clause "New" or "Revised" License
279 stars 41 forks source link

Support for asyncpg #195

Closed KentShikama closed 1 year ago

KentShikama commented 1 year ago

Apologies in advance for the lack of a MVCE. We are working on it.

We are seeing the following error.

                    try:
>                       ssl.load_cert_chain(
                            sslcert, keyfile=sslkey, password=lambda: sslpassword
                        )
E                       TypeError: 'NoneType' object is not callable

/usr/local/lib/python3.9/site-packages/asyncpg/connect_utils.py:553: TypeError

We have a strong suspicion that all we need to do is add "load_cert_chain" to the DUMMY_METHODS at https://github.com/mindflayer/python-mocket/blob/0cfa945359a87bfdd3cb06bb6ecdecc1ba601935/mocket/mocket.py#L76-L81 but would that be a problem if we validated that that works and submitted a patch?

mindflayer commented 1 year ago

would that be a problem if we validated that that works and submitted a patch?

Hi @KentShikama, definitely not a problem!

KentShikama commented 1 year ago

@mindflayer We just realized that we can set the ENV for PGSSLMODE=disable and it will just ignore the SSL issues as it then allows asyncpg to connect to the postgres server without using SSL.

Thanks for the confirmation anyways.