Closed Kras4ooo closed 9 years ago
@Kras4ooo Was this because you were trying to hit your own hosted version of Sentry?
I uploaded a sentry that virtual host. There are several projects under management because getsentry.com restrictions. Also the host that has ssl is untrusted, but not really untrusted. Otherwise version of Sentry is 6.0.0
@Kras4ooo My one concern with this PR is I believe (I could be wrong) that this will trust anything - which I don't think I want it do by default as that is potentially insecure. Can you add flag on the Sentry
client that defaults to not using this that but can be changed by the developer to use it if they want?
An if statement with that flag would then wrap this line https://github.com/joshdholtz/Sentry-Android/pull/19/files#diff-79ff5c611f0f93f64c7ba84ddeefc48eR380
Well I will add this if statement to be specified by the developer that wants to use this option or not.
@Kras4ooo Thanks!! I will take a look when you push the new code :grin:
Added if statement that checks whether set in verify_ssl dsn link. When set to 0, then it is assumed that ssl is untrusted. Any other number, or if you do not set this parameter will be assumed that the link is trusted.
Example (untrusted): http://your-dsn?verify_ssl=0 Example (trusted): http://your-dsn?verify_ssl=1 Example (trusted): http://your-dsn
@Kras4ooo Instead of putting it in the URL, can you make it a boolean on the Sentry
class? Below is an example of what I'm thinking...
// How to configure your client
Sentry.setVerifySSL(false);
// Modifications that are needed for Sentry
public class Sentry {
// other variables are here
private boolean verifySSL = true;
private static void setVerifySSL(boolean verifySSL) {
Sentry.getInstance().verifySSL = verifySSL;
}
// In that doCaptureEventPost method
httpClient = new DefaultHttpClient();
if (!Sentry.getInstance().verifySsl) {
httpClient = getHttpsClient(httpClient);
}
}
Let me know if you have any questions on what I am suggesting :smile:
I decided to keep the convention by Raven version Version 4.1.0. and so I added verify_ssl
in url, but there is no problem and added as a method :)
@Kras4ooo Ah, I was not actually aware of that verify_ssl in the URL - always good to learn new things :blush: You can keep it that way then!
I will play with that verify_ssl
query parameter commit tomorrow for ya!
Thanks!!! :)
@Kras4ooo Works good man! :+1: Want me to merge this in?
Yes there is no problem :)
:boom: Thanks for help! Do you have a Twitter account? I like to mention people in my tweets with updates :grin:
I had a problem accessing SSL, which are untrusted. Gave me 403 ERROR. This code fix my problem and decided to share it if it will benefit someone.