Comments (3)
Since i did not got any replies i decided to hack it and add the following configuration. Please let me know if its a good idea.
Created a following method on RavenClient.cs
private static bool ValidateRemoteCertificate(object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors policyErrors)
{
if (Convert.ToBoolean(ConfigurationManager.AppSettings["IgnoreSslErrors"]))
{
return true;
}
else
{
return policyErrors == SslPolicyErrors.None;
}
}
Added the following line to Send(JsonPacket packet, Dsn dns) method:
ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate);
Added the following to the web.config in appSettings
add key="IgnoreSslErrors" value="true"
from raven-csharp.
The idea is fine, I'm just not too fond of the implementation. Magic configuration settings like that are both hard to discover and test. It would probably be better with a public property on the RavenClient
class, either a Boolean
or perhaps a ServerCertificateValidationCallback
to provide full control.
from raven-csharp.
Since ServicePointManager.ServerCertificateValidationCallback
is a static event that applies to all SSL
connections within the thread, you can just do the following anywhere inside your application:
ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, policyErrors) =>
{
if (Convert.ToBoolean(ConfigurationManager.AppSettings["IgnoreSslErrors"]))
return true;
return policyErrors == SslPolicyErrors.None;
};
I don't see why we need to include any functionality around this within RavenClient
. I'm therefore closing this. Feel free to reopen if you have anything to add. Thanks! 😄
from raven-csharp.
Related Issues (20)
- Wrong device architecture in SharpRaven.Data.Context.Device HOT 1
- Don't report ILOffset as Line number HOT 7
- Unable to set contexts data HOT 9
- No stack traces for intentional error captures HOT 3
- Sentry skips User Agent parsing if context is set; SentryEvent.Context is internal HOT 4
- Feature - Add UnhandledExceptionEventHandler HOT 2
- Setting the user per Sentry Capture HOT 8
- User-created exceptions HOT 3
- Kill in repo-docs
- Development RavenClient HOT 1
- If there is any possibility to Compatible to .net 2.0 ? HOT 5
- Unable to capture the execution time on Sentry HOT 9
- Build.cake error
- Unity 2017 with .NET 3.5 not send events to Sentry HOT 1
- DllNotFoundExceptions and SecurityException when using with Mono HOT 32
- FileNotFoundException for System.Configuration.ConfigurationManager when referenced from .Net Standard library HOT 3
- Question: How to check if error occured while sending error from app to sentry server HOT 1
- Deprecated? HOT 4
- Consider using Ben.Demystifier for stack traces HOT 1
- When sentry server is down , my app is slow down HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raven-csharp.