aiven-client icon indicating copy to clipboard operation
aiven-client copied to clipboard

SSL error `SSLV3_ALERT_BAD_RECORD_MAC` on a fresh Mac install

Open kevinbowman-aiven opened this issue 3 years ago • 0 comments

What happened?

After installing the avn CLI by running pip install aiven-client on a Mac (as per https://developer.aiven.io/docs/tools/cli.html), I get the following error when trying to run commands like avn project list or avn account list):

SSLError(SSLError(1, '[SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:1125)'

What did you expect to happen?

I expected to see a list of my projects or accounts.

What else do we need to know?

This seems to be a problem related to the out-of-the-box SSL implementation on Macs (LibreSSL). I solved it locally by installing OpenSSL through homebrew and then using a homebrew version of python using the following steps:

  1. brew install openssl
  2. Make sure the $PATH contains the relevant parts from homebrew at the front (mine is now PATH=/opt/homebrew/opt/openssl@3/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin)
  3. brew reinstall python (which puts python3 and pip3 into /opt/homebrew/bin but doesn't replace the local python)
  4. pip3 install aiven-client

After those steps, I have /opt/homebrew/bin/avn available which works fine.

kevinbowman-aiven avatar Jan 19 '22 14:01 kevinbowman-aiven