Coder Social home page Coder Social logo

docker-postgres-cert's Introduction

Docker Postgres Demo with Certificate

This repo is for running a Docker postgres image with SSL based on the library postgres 9.4 image.

Rational

I created this to see application behavior with an invalid/out of date certificate on the postgres server. You can modify the certificate approval parameters in the file create-certs.sh. For more information about approving a CSR, check the openssl help output by running:

openssl ca -h

Build

To build yourself, I'm assuming you have docker installed. You may want to do this if you don't use postgres 9.3 or 9.4

git clone [email protected]:micahhausler/docker-postgres-cert.git
cd docker-postgres-cert/
docker build -t $(whoami)/postgres-ssl .

Download

docker pull micahhausler/postgres-outdated-ssl:9.3
# or
docker pull micahhausler/postgres-outdated-ssl:9.4

Use

First get postgres up and running:

docker run -t --name postgres -h postgres -p 5432:5432 $(whoami)/postgres-ssl

Then connect with the proper sslmode parameter that your client uses to connect to postgres. (libpq docs)

  • disable - will not use ssl
  • allow - will revert to non-ssl mode with an outdated cert
  • prefer - will revert to non-ssl mode with an outdated cert
  • require - will fail with an outdated cert
  • verify-ca - will fail with an outdated cert
  • verify-full- will fail with an outdated cert
psql "sslmode=prefer host=$(boot2docker ip) port=5432 user=postgres"

or

export PGSSLMODE="prefer"
psql -U postgres -h $(boot2docker ip) -p 5432

MIT License

See the LICENSE file for full information.

docker-postgres-cert's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.