Comments (7)
Sure. Anything specific?
Here's the official docs on how to configure SSL for the CouchDb server. If you use a certificate that passes the default validation (trusted cert, machine name matches, valid dates, etc), everything should just work over SSL. But if you're cert fails the default validation (self-signed cert like in their instructions, machine name doesn't match, expired, etc), HttpClient
won't allow the connection. One way around that is configuring Flurl to do custom certificate validation at the app level as mentioned in #4.
FlurlHttp.ConfigureClient(serverUri.ToString(), c =>
{
c.Settings.HttpClientFactory = new CertClientFactory();
});
public class CustomCertClientFactory : DefaultHttpClientFactory
{
public override HttpMessageHandler CreateMessageHandler()
{
return new HttpClientHandler()
{
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
{
// TODO Implement actual cert validation
return true;
}
};
}
}
from couchdb-net.
So, with this code it will always validate the certificate?
Is it safe?
from couchdb-net.
Sorry stupid question, is up to the user use a valid certificate.
Thank you!
from couchdb-net.
Exactly, this code will always accept any cert presented, so it's not safe. As it sits in my above code snippet, the SSL would provide encryption, but not validate that the server is who you expect. It's up to the user to implement cert validation at that TODO
to decide whether it will accept the certificate
from couchdb-net.
I'll add a "IgnoreCertificateValidation" and "ConfigureCertificateValidation(func)" so user can decide what to do.
from couchdb-net.
@borigas
The iQueryable should be almost ready for release if you want to test something or if you have any suggestions.
from couchdb-net.
var client = new CouchClient(
"http://localhost:5984", s => s
.ConfigureCookieAuthentication("root", "relax")
.IgnoreCertificateValidation()
);
from couchdb-net.
Related Issues (20)
- Non-nullable Tables in Context HOT 4
- Exception when running a query. HOT 2
- CouchDB.NET.DependencyInjection HOT 1
- Support retrieving available revisions of a document HOT 9
- Bug with querying overlaping string arrays HOT 6
- Use design documents with CouchDB.Net HOT 1
- Database Splitting + FirstOrDefault() + CouchContext.MyDatabase.Where doesn't apply predicate
- Database Splitting + Convert --> Crash : Exception thrown: Call failed with status code 400 (Bad Request) HOT 2
- Database Splitting : create selector on type (SplitDiscriminator)
- Support raw/un-typed documents? HOT 1
- Replication : add "create_target" field HOT 1
- "Cannot add or update a document without an ID." System.InvalidOperationException HOT 2
- Performance implications / Gotchas ? HOT 1
- Add Replication state HOT 2
- Change feed not including attachments as per specification HOT 1
- How to deserialize inherited documents? HOT 3
- Add Partitioned Database support
- Unexpected behaviour of GetContinuousChangesAsync HOT 3
- Please release v3.5.0 NuGet HOT 2
- Get all databases on server 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 couchdb-net.