Hello. Currently I have a django app running on a droplet. And I am using your Managed Database for postgresql. Currently my connection has ssl-mode set to ‘require’, but I want to change the ssl-mode to 'verify-full’. I have changed django app settings like the following:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': DATABASE_NAME,
'USER': DATABASE_USER,
'PASSWORD': DATABASE_PASSWORD,
'HOST': MANAGED_DATABASE_HOST,
'PORT': MANAGED_DATABASE_PORT,
'OPTIONS': {
'sslmode': 'verify-full',
},
}
}
I have downloaded the CA certificate given in the database cluster overview page in connection details. I have put the certificate in ~/.postgresql/ folder. I have read the postgresql documentation and realized that I need four files ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.key ~/.postgresql/root.crt ~/.postgresql/root.crl
Where can I find the files? Please Someone give a proper guidence about how to do this step by step as I am a complete newbie in this field. Thanks in advance.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi, I was just wondering if you had any luck with this and if you’ve managed to get it working?
You shouldn’t need all 4 of those… I have this on my dev box and it connects with no isue.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '<name>',
'USER': '<user>',
'PASSWORD': '<password>',
'HOST' : '<host>',
'PORT' : '25060',
'OPTIONS':{
'sslmode':'verify-full',
'sslrootcert': os.path.join(BASE_DIR, 'ca-certificate.crt')
}
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.