support https in jenkins.coffee #1267

Open
larrycai opened this Issue Jan 9, 2014 · 15 comments

Comments

Projects
None yet
4 participants

larrycai commented Jan 9, 2014

So far it has limited support for https, for example, for some https, Unauthorized request can be accepted, which in turn, we need to set options in https request

rejectUnauthorized to false

Owner

technicalpickles commented Jan 9, 2014

I just looked at the code, but didn't have that take away. Have you tried to use it and failed? It uses a general JENKINS_URL, so if that is https://whatever it's over https and if it's http://whatever, it's over http, and should just work.

Also, what version of hubot-scripts are you using?

larrycai commented Jan 9, 2014

Yes, it is failed for sure, mostly it needs to use "request" module. or extra codes for msg.http (new to here)

I use the latest version of hubot-scripts.

And the node.js jenkisn-api module can be used here to make the function easily.

Owner

technicalpickles commented Jan 9, 2014

How did it fail exactly? Can you share a transcript of commands used, and error logs you got back?

msg.http is https://github.com/technoweenie/node-scoped-http-client scope. It knows enough to call with http or https depending on the URL given.

And the node.js jenkisn-api module can be used here to make the function easily.

That could be useful. If we are going to add a dependency though, probably should extract this to it's own repository cc #1113

probably it can support https as well, it seem we just missed server
certificatation locally, which looks like it doesnot support https.

I tried your method using jenkins-api, looks much clean, not complete,
therefore no pull request

On Fri, Jan 10, 2014 at 6:51 AM, Josh Nichols notifications@github.comwrote:

How did it fail exactly? Can you share a transcript of commands used, and
error logs you got back?

msg.http is https://github.com/technoweenie/node-scoped-http-clientscope. It knows enough to call with http or https depending on the URL
given.

And the node.js jenkisn-api module can be used here to make the function
easily.

That could be useful. If we are going to add a dependency though, probably
should extract this to it's own repository cc #1113#1113


Reply to this email directly or view it on GitHubhttps://github.com/github/hubot-scripts/issues/1267#issuecomment-31985742
.

True software development embraces consistent inconsistency.
blog: http://larrycaiyu.com/blog (en), http://larrycaiyu.com (chinese)

sorry, my fault. it support https as well, you can close this.

But It depends on client, it works in my ubuntu VM directly with
rejectUnauthorized=false, in other client, it doesn't work, it happens in
jenkins-api module as well.

On Fri, Jan 10, 2014 at 3:41 PM, Larry Cai larry.caiyu@gmail.com wrote:

probably it can support https as well, it seem we just missed server
certificatation locally, which looks like it doesnot support https.

I tried your method using jenkins-api, looks much clean, not complete,
therefore no pull request

On Fri, Jan 10, 2014 at 6:51 AM, Josh Nichols notifications@github.comwrote:

How did it fail exactly? Can you share a transcript of commands used, and
error logs you got back?

msg.http is https://github.com/technoweenie/node-scoped-http-clientscope. It knows enough to call with http or https depending on the URL
given.

And the node.js jenkisn-api module can be used here to make the function
easily.

That could be useful. If we are going to add a dependency though,
probably should extract this to it's own repository cc #1113#1113


Reply to this email directly or view it on GitHubhttps://github.com/github/hubot-scripts/issues/1267#issuecomment-31985742
.

True software development embraces consistent inconsistency.
blog: http://larrycaiyu.com/blog (en), http://larrycaiyu.com (chinese)

True software development embraces consistent inconsistency.
blog: http://larrycaiyu.com/blog (en), http://larrycaiyu.com (chinese)

  1. in current jenkins-api, build function is not completed, I just send the pull request.
  2. hopefully in new solution, we could had one extra env like
    HUBOT_JENKINS_HTTPS_REJECT_UNAUTHORIZED to make it fit more cases

http://stackoverflow.com/questions/20296212/use-options-with-nodes-scoped-http-client-set-rejectunauthorized-to-falsethis
is the problem I meet for https

On Fri, Jan 10, 2014 at 5:10 PM, Larry Cai larry.caiyu@gmail.com wrote:

sorry, my fault. it support https as well, you can close this.

But It depends on client, it works in my ubuntu VM directly with
rejectUnauthorized=false, in other client, it doesn't work, it happens in
jenkins-api module as well.

On Fri, Jan 10, 2014 at 3:41 PM, Larry Cai larry.caiyu@gmail.com wrote:

probably it can support https as well, it seem we just missed server
certificatation locally, which looks like it doesnot support https.

I tried your method using jenkins-api, looks much clean, not complete,
therefore no pull request

On Fri, Jan 10, 2014 at 6:51 AM, Josh Nichols notifications@github.comwrote:

How did it fail exactly? Can you share a transcript of commands used,
and error logs you got back?

msg.http is https://github.com/technoweenie/node-scoped-http-clientscope. It knows enough to call with http or https depending on the URL
given.

And the node.js jenkisn-api module can be used here to make the function
easily.

That could be useful. If we are going to add a dependency though,
probably should extract this to it's own repository cc #1113#1113


Reply to this email directly or view it on GitHubhttps://github.com/github/hubot-scripts/issues/1267#issuecomment-31985742
.

True software development embraces consistent inconsistency.
blog: http://larrycaiyu.com/blog (en), http://larrycaiyu.com (chinese)

True software development embraces consistent inconsistency.
blog: http://larrycaiyu.com/blog (en), http://larrycaiyu.com (chinese)

True software development embraces consistent inconsistency.
blog: http://larrycaiyu.com/blog (en), http://larrycaiyu.com (chinese)

larrycai closed this Jan 17, 2014

Owner

technicalpickles commented Jan 17, 2014

Why did you close? From the blog post, sounds like still need to do the reject unauthorized thing.

larrycai reopened this Jan 17, 2014

Actually I asked the IS/IT to fix the https in jenkins server side (they should fix it), then jenkins.coffee works perfect ;-). So I think this reject unauthorized thing should be fixed in server side always.

And also I saw it was connected with others, keep that open and close this, not so clear the process. anyway reopen again.

Contributor

rgbkrk commented Jan 30, 2014

Oh hey, this is exactly the use case for why I made PR github/hubot#612. If you still want me to approach this a bit more (to also include handling gzip via scoped http client), I can work on this in a couple days (work+getting on a plane soon).

Owner

technicalpickles commented Feb 3, 2014

@rgbkrk if you are up for it, totally!

I don't actually use the jenkins script myself, or have jenkins running directly (we use janky built on top of it), so anyone interested in taking over this script, and moving it to an external package (ie #1113), they would be deserving of many ⚡️

Contributor

rgbkrk commented Feb 3, 2014

Oh, I guess I should say it's not about Jenkins for me but about gzip handling and for unauthorized requests (Node and SSL certs are still kind of messy to me - I need enlightenment).

Sorry about my lack of context, I'm saying I could probably work on github/hubot#612

Has there been any news on this issue? I recently turned HTTPS on for my Jenkins server and am having trouble getting this script to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment