This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 221557 - Impossible to make GIT->Remote->PUSH, error cannot connect to HTTPS
Summary: Impossible to make GIT->Remote->PUSH, error cannot connect to HTTPS
Status: RESOLVED WONTFIX
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-06 12:46 UTC by jonathanvilalopez
Modified: 2014-02-18 17:11 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (145.83 KB, text/plain)
2012-11-06 12:46 UTC, jonathanvilalopez
Details
Messages Log to show (93.50 KB, text/x-log)
2012-11-07 12:36 UTC, jonathanvilalopez
Details
Netbeans Dev ( 20121106 ) messages log (129.62 KB, text/x-log)
2012-11-07 12:50 UTC, jonathanvilalopez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jonathanvilalopez 2012-11-06 12:46:26 UTC
Product Version = NetBeans IDE Dev (Build 201211060001)
Operating System = Linux version 3.2.0-30-generic running on amd64
Java; VM; Vendor = 1.7.0_07
Runtime = OpenJDK 64-Bit Server VM 23.2-b09

Everytime I try to do a Git Push to a remote HTTPS repository Netbeans show an error : cannot connect to HTTPS

Also tried on NB 7.2, NB 7.3 Beta, NB Nightly Build ( 20121106 )
Comment 1 jonathanvilalopez 2012-11-06 12:46:34 UTC
Created attachment 127225 [details]
IDE log
Comment 2 Ondrej Vrabec 2012-11-07 08:31:55 UTC
INFO [org.netbeans.modules.git.ui.repository.remote.SelectUriStep]: Cannot connect to https://jonathan@192.168.60.176:8443/git/conectores/interface/Travelclick.git
java.security.cert.CertificateException: No subject alternative names present
	at sun.security.util.HostnameChecker.matchIP(HostnameChecker.java:142)
	at sun.security.util.HostnameChecker.match(HostnameChecker.java:91)
	at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:347)
	at sun.security.ssl.AbstractTrustManagerWrapper.checkAdditionalTrust(SSLContextImpl.java:847)
	at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:814)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1320)

Does the server have a self-signed certificate? Then add:
> [http]
> sslVerify = false
to your .git/config file in the repository root.

*** This bug has been marked as a duplicate of bug 219691 ***
Comment 3 jonathanvilalopez 2012-11-07 09:08:45 UTC
I've tried that in my git config file.

The fact is that if I do it on command line all works well, but from Netbeans is impossible....



This is the content of my git config file :

[core]
	repositoryformatversion = 0
	filemode = true
	logallrefupdates = true
	bare = false
[remote "origin"]
	url = https://jonathan@192.168.60.176:8443/git/conectores/interface/Travelclick.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[http]
	sslVerify=false
Comment 4 Ondrej Vrabec 2012-11-07 10:08:02 UTC
> The fact is that if I do it on command line all works well, but from Netbeans
is impossible....
Impossible how? Attach the messages.log with sslVerify disabled.
Comment 5 jonathanvilalopez 2012-11-07 12:36:46 UTC
Created attachment 127302 [details]
Messages Log to show
Comment 6 Ondrej Vrabec 2012-11-07 12:46:22 UTC
(In reply to comment #5)
> Created attachment 127302 [details]
> Messages Log to show
That's from 7.2Beta, please try again with the latest dev build.
Comment 7 Ondrej Vrabec 2012-11-07 12:48:45 UTC
or at least the installation folder seems weird: Installation            = /datos/jonathan/Programas/netbeans-7.2beta. Plus there is no exception coming from git.
Comment 8 jonathanvilalopez 2012-11-07 12:50:27 UTC
Created attachment 127306 [details]
Netbeans Dev ( 20121106 ) messages log
Comment 9 Ondrej Vrabec 2012-11-07 13:07:12 UTC
Can you try adding the directive to your global user gitconfig file?
cat ~/.gitconfig
[http]
    sslVerify = false
Comment 10 jonathanvilalopez 2012-11-07 13:58:00 UTC
(In reply to comment #9)
> Can you try adding the directive to your global user gitconfig file?
> cat ~/.gitconfig
> [http]
>     sslVerify = false

I already have it....

~/.gitconfig

[http]
  sslVerify = false
Comment 11 Ondrej Vrabec 2012-11-07 14:05:35 UTC
i thought you had added it just to the local repository's config as you posted in Comment #3. I had no idea you had added the setting to both. In that case i have no idea what might be wrong.
Comment 12 Ondrej Vrabec 2012-11-07 20:21:35 UTC
this may be related:
http://www.coderanch.com/t/134384/Security/Getting-error-No-subject-alternative
http://stackoverflow.com/questions/3622788/self-signed-certificates-java-hudson-and-jira
Maybe you should consider regenerate your server cert. Can you print and attach here the cert info?
Comment 13 Ondrej Vrabec 2012-11-09 12:56:16 UTC
i'm getting the same for our test server if i use its IP address instead of the hostname assigned to it.
Use the server's hostname to connect or fix the certificate to contain also IP address (as suggested in the links i pasted here in my previous comment).
Comment 14 jonathanvilalopez 2012-11-09 14:29:09 UTC
(In reply to comment #13)
> i'm getting the same for our test server if i use its IP address instead of the
> hostname assigned to it.
> Use the server's hostname to connect or fix the certificate to contain also IP
> address (as suggested in the links i pasted here in my previous comment).

I've changed it and used the hostname ( in my linux editing my /etc/hosts file ), but the result is the same.

But why if I do the push on commandline works successfully but with Netbeans it does not work ?
Comment 15 Ondrej Vrabec 2012-11-09 15:59:30 UTC
You may have accepted the server certificate with commandline client and the cert can now be stored somewhere on disk. NetBeans IDE does not use commandline client but a pure java implementation called JGit and Java probably does not look at your accepted certificates.
Comment 16 jonathanvilalopez 2012-11-09 16:44:58 UTC
(In reply to comment #15)
> You may have accepted the server certificate with commandline client and the
> cert can now be stored somewhere on disk. NetBeans IDE does not use commandline
> client but a pure java implementation called JGit and Java probably does not
> look at your accepted certificates.

Finally I've get the answer ( http://micro-blog.chuidiang.org/content/gitblit-egitjgit-y-certificados-de-servidor .. in spanish )

TRANSLATE :

"Gitblit, Egit/Jgit and server certificates

gitblit creates by default one server certificate autosigned and generated for "localhost"

To normal git clients you can add this certificate in their store to accept it or tell it to ignore it :

    git config http.sslVerify false

However , Egit/Jgit, eclipse git plugins , independently that they admit autosigned certificates, they demand that it has to be created for the URL server to connect to. If the repository is in  https://miservidor/repo, the certificate hast to be created for "miservidor" and not for "localhost"

gitblit allows to create specific autosigned certificates, editing the file makekeystore.cmd (o makekeystore.shd), changing HOSTNAME=localhost for the server name. "
Comment 17 elect 2014-02-18 17:11:52 UTC
(In reply to jonathanvilalopez from comment #16)
> However , Egit/Jgit, eclipse git plugins , independently that they admit
> autosigned certificates, they demand that it has to be created for the URL
> server to connect to. If the repository is in  https://miservidor/repo, the
> certificate hast to be created for "miservidor" and not for "localhost"
> 
> gitblit allows to create specific autosigned certificates, editing the file
> makekeystore.cmd (o makekeystore.shd), changing HOSTNAME=localhost for the
> server name. "

Hi jonathan, 

I have your same problem

Can you please clarify this passage?