Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking Ignore unverified SSL certificates does not actually ignore #13

Closed
sarahtattersall opened this issue Jul 30, 2013 · 7 comments
Closed
Milestone

Comments

@sarahtattersall
Copy link
Contributor

Even though I have 'Ignore unverified SLL certificates' I still get the message:
'SSLPeerUnverifiedException caught while notifying Stash. Make sure your SSL certificate on your Stash server is valid or check the 'Ignore unverifiable SSL certificate' checkbox in the Stash plugin configuration of this job.' in my console output.

gruetter pushed a commit that referenced this issue Aug 7, 2013
…Stash.

Previously would still throw SSLPeerUnveritifiedException even when checked
so replaced SSLContext and UnsafeX509TrustManager with TrustStrategy as advised on
the following StackOverflow link:
http://stackoverflow.com/questions/9101763/sslpeerunverifiedexception-with-httpclient
@ghost
Copy link

ghost commented Oct 18, 2013

Hello, we had the same problem... debugging the plugin on a actual jenkins i found out, that the instance variables (private final String stashServerBaseUrl etc..) where always null... So for some reason:

@DataBoundConstructor
public StashNotifier(

was not doing its Job and setting the properties...

only explanation for me was, that Jenkins is setting the Properties by Reflection somhow ...

an then the problem was:

if (!ignoreUnverifiedSSL) {
ignoreUnverifiedSSL = descriptor.isIgnoreUnverifiedSsl();
}
if (getStashServerBaseUrl().startsWith("https")
&& ignoreUnverifiedSSL) {
// add unsafe trust manager to avoid thrown
// SSLPeerUnverifiedException
try {

never went into the case "https"

As quick and dirty solution we builded our own patched Plugin with all the Instance Variable Settings hard coded and made final

Was there a change in the jenkins plugin configuration api latly?

Best regards and thank you for the development of the great plugin

Daniel

@resah
Copy link

resah commented Apr 23, 2014

Hi,

noticed two points:

  1. in global.jelly it should probably be:

      <f:checkbox name="stashNotifier.ignoreUnverifiedSsl" 
                  checked="${descriptor.isIgnoreUnverifiedSsl()}"/>
    
  2. in StashNotifier.getHttpClient() it would help to check URL from global configuration, too:

    private HttpClient getHttpClient(final PrintStream logger) {
    
        HttpClient client = null;
        boolean ignoreUnverifiedSSL = ignoreUnverifiedSSLPeer;
        String url = stashServerBaseUrl;
        DescriptorImpl descriptor = getDescriptor();
    
        if ("".equals(url) || url == null) {
            url = descriptor.getStashRootUrl();
        }
    
        if (!ignoreUnverifiedSSL) {
            ignoreUnverifiedSSL = descriptor.isIgnoreUnverifiedSsl();
        }
    
        if (url.startsWith("https") && ignoreUnverifiedSSL) {
            ...
        }
    }
    

Anyhow, thanks for this helpful plugin!

Regards

Theresa

Edit: Added changes as pull request ;)

resah pushed a commit to resah/stashnotifier-plugin that referenced this issue Apr 23, 2014
… check

If no configuration for repository was set use global Stash URL to check whether HTTPS should be used.
resah pushed a commit to resah/stashnotifier-plugin that referenced this issue Apr 23, 2014
@resah resah mentioned this issue Apr 23, 2014
resah pushed a commit to resah/stashnotifier-plugin that referenced this issue Apr 24, 2014
@ir73
Copy link

ir73 commented Jun 17, 2014

When this fix is going to get into Jenkins plugin repo?

@roboll
Copy link

roboll commented Oct 29, 2014

is there a plan to release a version of the plugin with this fix?

@gruetter
Copy link
Member

I've just distributed a Snapshot version to to more devs with the same problem to confirm the fix works. I plan to release ASAP after the confirmation (can't test myself, currently). Hang in there

@gruetter
Copy link
Member

gruetter commented Nov 7, 2014

I'm trying to create a setup with an unverified SSL certificate. Stash is now up and running. I can clone a repo using https on the command line. I was not able to get it running in Jenkins though. When trying to configure the git repo url, I got a "Invalid certificate chain" error. Can s.o. please give me a hint as to what needs to be done here? Are you cloning via ssh or https? Did you have to configure Jenkins to make this work?

@gruetter
Copy link
Member

gruetter commented Dec 7, 2014

Changes are included in release 1.7.

@gruetter gruetter closed this as completed Dec 7, 2014
mdkf pushed a commit to mdkf/stashnotifier-plugin that referenced this issue Apr 13, 2017
…ushes to Stash.

Previously would still throw SSLPeerUnveritifiedException even when checked
so replaced SSLContext and UnsafeX509TrustManager with TrustStrategy as advised on
the following StackOverflow link:
http://stackoverflow.com/questions/9101763/sslpeerunverifiedexception-with-httpclient
mdkf pushed a commit to mdkf/stashnotifier-plugin that referenced this issue Apr 13, 2017
… check

If no configuration for repository was set use global Stash URL to check whether HTTPS should be used.
mdkf pushed a commit to mdkf/stashnotifier-plugin that referenced this issue Apr 13, 2017
mdkf pushed a commit to mdkf/stashnotifier-plugin that referenced this issue Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants