Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netbeans & Mercurial - Clone a repository from a server with self-signed certificate

I have a web server that share mercurial repositories. It shares projects in HTTPS with a self-signed certificate.

If I want to clone a repository, I can use the command (note the --insecure option that say to don't worry about certificate).

hg clone --insecure https://server/repository

My question is: how to do that with the Netbeans Mercurial plugin. If I try to do that, I have the following error:

Output: [abort: error: _ssl.c:490: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed]

Thanks

like image 931
RaemyD Avatar asked May 19 '11 08:05

RaemyD


2 Answers

Since version 1.7.4 of mercurial you can use the hostfingerprints section in .hgrc to explicitly trust your host. This also works when calling mercurial from Netbeans.

like image 119
Aldo Avatar answered Sep 23 '22 21:09

Aldo


I found a solution. It is almost like, as suggested by Aldo.

All you have to do is find out your provider's certificate (ask them through email, they replied me), it looks like http://www.selenic.com/mercurial/hgrc.5.html#hostfingerprints

then make an entry in mercurial.ini. I found this file in C:\Users\MyUser\mercurial.ini

[hostfingerprints]
hg.java.net = 22:d2:d5:43:96:0f:eb:e0:9a:20:b9:14:b4:d9:32:1e:6a:f3:37:11

Once I did this, Netbeans was able to clone the repository from java.net successfully. Hope this helps. Let me know if this doesn't work.

In case you are unable to get the certificate, then you can do this How to entirely disable SSL certificate checks in Mercurial / TortoiseHg?

like image 34
coding_idiot Avatar answered Sep 25 '22 21:09

coding_idiot