git push to bitbucket.org fails due to OpenSSL errors
Asked by Andrin Meier:

Hello,

I and many of my coworkers have problems pushing and pulling from bitbucket.org. The error is:

```
OpenSSL SSL_connect: Connection was aborted in connection to bitbucket.org:443 
```

Another similar error we get is:

```
OpenSSL SSL_read: Connection was reset, errno 10054
```

Is this a known issue? Does anyone know what's wrong?

Best regards


Answers:
author: Mark C
body: Hi [@Andrin Meier](/t5/user/viewprofilepage/user-id/3449076)

Thank you for reaching out to the community.

Based on the error message you're getting, it seems that you're unable to connect to Bitbucket.org via port 443.  
To verify this further, can you try to do a **telnet** command against Bitbucket.org?

```
telnet bitbucket.org 443
```

<br />

Also, would it be possible for you to confirm if you're able to access the site <https://bitbucket.org/> in your browser?

Let me know how it goes.

Regards,  
Mark C

comments: author: Andrin Meier
body: telnet works, visiting bitbucket.org in the browser works as well. We have also confirmed that it is not a firewall problem. The same problem appeared just today on a coworker's laptop without going through the firewall. This problem happens not only with HTTPS but also with SSH. It usually works after trying a few times. Is there something else we could check? It doesn't seem to be a problem on our end, unless it has something to do with our ISP?


author: Mark C
body: Hi [@Andrin Meier](/t5/user/viewprofilepage/user-id/3449076)

Got it.

Could you check if you're connecting to Bitbucket.org through an IPv6 connection?

You can check this by cloning your repository with the debug commands below:  

**Git Bash / Linux**:

```
GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_SSH_COMMAND="ssh -v" GIT_CURL_VERBOSE=1 git clone <your repository URL>
```

Find the specific log about:

```
* Connected to bitbucket.org (SOME_IP_HERE) port 443 (#0)
```

![](https://getsupport.atlassian.com/images/icons/emoticons/information.png) **SOME_IP_HERE** could be IPv4 or IPv6 format

<br />

If you're connecting via IPv6, can you try enforcing the Ipv4 connection instead by adding the flag **--ipv4** in your Git commands?  

E.g.

```
git clone?--ipv4 <some repo URL>git push?--ipv4
```

Let me know how it goes.  

Regards,  
Mark C


author: Andrin Meier
body: I've run your command and it looks like we're already connecting through IPv4 unfortunately. Is there anything else we could try?


author: Mark C
body: Hi [@Andrin Meier](/t5/user/viewprofilepage/user-id/3449076)

Got it.  
In this case, would you be able to try to connect with a different ISP/network connection and see if it is also happening there?

Regards,  
Mark C


author: Andrin Meier
body: It does seem to only happen with one specific ISP. We'll investigate further.


author: Chen-Fu Liao
body: Hi,

I have a similar issue trying to push to Bitbucket from Source Tree.

I followed this link to successfully add an app password in Source Tree. It displayed a green check with 'authentication OK'.

[https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/?utm_source=alert-email\&utm_medium=email\&utm_campaign=bbc-login-deprecation_EML-12079\&jobid=105398046\&subid=1521213750](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/?utm_source=alert-email&utm_medium=email&utm_campaign=bbc-login-deprecation_EML-12079&jobid=105398046&subid=1521213750)

However, when I tried to push to Bitbucket. I got the following error.

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags origin \<my branch package\>  
**fatal: unable to access '\<my repo URL\>': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to bitbucket.org:443**   
Pushing to\<my repo URL\>  
Completed with errors, see above.

I tried the following command you suggested.

GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_SSH_COMMAND="ssh -v" GIT_CURL_VERBOSE=1 git clone \<my repo URL\>

I got the following error.

\* Connected to bitbucket.org (104.192.141.1) port 443 (#0)  
\* ALPN, offering http/1.1  
\* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH  
\* successfully set certificate verify locations:  
\* CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt  
CApath: none  
\* **OpenSSL SSL_connect: SSL_ERROR_SYSCALL** in connection to bitbucket.org:443  
\* Closing connection 0  
**fatal: unable to access '\<my repo url\>': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to bitbucket.org:443**

Any thoughts on why the authentication is OK but I cannot push to my repo?


Tags: bitbucket-cloud

cloud