2

I am Setting the sonar system for C++ Binaries and i am trying with https Setup.

See the Connector element in Server.xml

 <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
     maxThreads="150" scheme="https" secure="false"
     clientAuth="false" sslProtocol="TLS"
     keystoreFile="D:/sonar_framework/apache-tomcat-7.0.35/conf/.keystore" keystorePass="changeit"
     ciphers="SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA"/>

And sonar.host.url=https://b1.co:8443/sonar/ in Sonar-runner.properties

i gave the localhost also for the next try,

But it shows the error

Exception in thread "main" java.lang.IllegalStateException: Fail to request server version
        at org.sonar.runner.Bootstrapper.getServerVersion(Bootstrapper.java:73)
        at org.sonar.runner.Runner.checkSonarVersion(Runner.java:220)
        at org.sonar.runner.Runner.execute(Runner.java:150)
        at org.sonar.runner.Main.execute(Main.java:84)
        at org.sonar.runner.Main.main(Main.java:56)
Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching <machine Name> found
        at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
        at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1902)
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276)
        at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270)
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1341)
        at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:153)
        at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)
        at sun.security.ssl.Handshaker.process_record(Handshaker.java:804)
        at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1032)
        at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1328)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
        at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:515)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
        at java.net.URLConnection.getContent(URLConnection.java:748)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContent(HttpsURLConnectionImpl.java:434)
        at org.sonar.runner.Bootstrapper.remoteContent(Bootstrapper.java:125)
        at org.sonar.runner.Bootstrapper.getServerVersion(Bootstrapper.java:71)
        ... 4 more
Caused by: java.security.cert.CertificateException: No name matching blrkmis1977pc.in002.siemens.net found
        at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:208)
        at sun.security.util.HostnameChecker.match(HostnameChecker.java:93)
        at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:347)
        at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:203)
        at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1323)
        ... 18 more

help me to resolve this.

Jayendran
  • 9,638
  • 8
  • 60
  • 103
Britto Raj
  • 401
  • 1
  • 5
  • 15
  • Are you using a self signed cert? Also, the stracktrace is for localhost, do you get one when you don't use localhost, but the full domain name? – Larry Shatzer Feb 28 '13 at 21:48
  • I am using the full domain name also and self signed certified. Still i am facing the issue. – Britto Raj Mar 01 '13 at 03:40

2 Answers2

3

You need to tell Java to accept the self signed cert. See this SO post (option 1 in the accepted answer).

Community
  • 1
  • 1
Larry Shatzer
  • 3,579
  • 8
  • 29
  • 36
0

I suppose you should check your sonar server, in your log, you server is using port 8443, so you should use the following command to check is this port still listening?? netstat -anl | grep 8443

or

you just restart the sonar server.

Han.Oliver
  • 525
  • 5
  • 8