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

Uses https endpoint and root cert verification #14

Merged
merged 2 commits into from
Apr 1, 2014

Conversation

gregburek
Copy link
Contributor

Pagerduty appears to be disabling HTTP requests to the API. This PR adds HTTPS.

@gregburek
Copy link
Contributor Author

Hey @notahat, any chance of getting this merged? My info is that HTTP is going away in about a month.

@hgmnz
Copy link

hgmnz commented Mar 28, 2014

Given plain text is being deprecated (and is just plain wrong), +1 to this. Could it please be merged and a gem released?

@neilberkman
Copy link

+1

1 similar comment
@chooper
Copy link

chooper commented Mar 28, 2014

+1

require 'pagerduty/version'

RootCA = '/etc/ssl/certs'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we put this inside Pagerduty instead of exposing a global constant?

@stevehodgkiss
Copy link

Aside from comment, LGTM. +1

@jamesrwhite
Copy link

+1

@gregburek
Copy link
Contributor Author

I moved the rootca path moved to where it is used in determining if strict verification is necessary. I also tested this branch in our monitoring app and was successful in triggering an PD incident.

Is this worthy of a version bump so we can be sure that the https code is being brought in?

@johnsyweb
Copy link
Contributor

👍

if (File.directory?(rootca) && http.use_ssl?)
http.ca_path = rootca
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.verify_depth = 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this setting. What happens when the certificate chain is longer than five?

What if we don't set it? Can we live with verifying potentially infinite certificate chains?
If we must set it, are we sure 5 a good number?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pwelch
Copy link

pwelch commented Mar 31, 2014

+1

1 similar comment
@trobrock
Copy link

trobrock commented Apr 1, 2014

👍

notahat added a commit that referenced this pull request Apr 1, 2014
Uses https endpoint and root cert verification
@notahat notahat merged commit 7d77b93 into envato:master Apr 1, 2014
@jamesbouressa
Copy link

This:
http.ca_path = rootca
breaks your code on my CentOS 6.3 machine. Commenting that out fixes my problem.

@jamesbouressa
Copy link

Can you change your code so that you only set the http.ca_path when there's a problem with the current default for your platform? Eg:

http://ruby-doc.org/stdlib-2.0/libdoc/openssl/rdoc/OpenSSL/X509/Store.html#method-i-set_default_paths

@gregburek
Copy link
Contributor Author

@jamesbouressa You may want to add onto a new issue about this problem. I opened #15.

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

Successfully merging this pull request may close these issues.

None yet