Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0][IMP] core: sslmode postgres #1239

Open
wants to merge 1 commit into
base: 10.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion odoo/sql_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ def connection_info_for(db_or_uri):
return db_name, {'dsn': db_or_uri}

connection_info = {'database': db_or_uri}
for p in ('host', 'port', 'user', 'password'):
for p in ('host', 'port', 'user', 'password', 'sslmode', 'sslrootcert'):
cfg = tools.config['db_' + p]
if cfg:
connection_info[p] = cfg
Expand Down
12 changes: 8 additions & 4 deletions odoo/tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ def __init__(self, fname=None):
help="specify the database host")
group.add_option("--db_port", dest="db_port", my_default=False,
help="specify the database port", type="int")
group.add_option("--db_sslmode", dest="db_sslmode", type="choice", my_default='prefer',
choices=['disable', 'allow', 'prefer', 'require', 'verify-ca', 'verify-full'],
help="specify the database ssl connection mode (see PostgreSQL documentation)")
group.add_option("--db_sslrootcert", dest="db_sslrootcert", help="specify the cert path (see PostgreSQL documentation)")
group.add_option("--db_maxconn", dest="db_maxconn", type='int', my_default=64,
help="specify the the maximum number of physical connections to posgresql")
group.add_option("--db-template", dest="db_template", my_default="template1",
Expand Down Expand Up @@ -384,10 +388,10 @@ def die(cond, msg):

# if defined dont take the configfile value even if the defined value is None
keys = ['xmlrpc_interface', 'xmlrpc_port', 'longpolling_port',
'db_name', 'db_user', 'db_password', 'db_host',
'db_port', 'db_template', 'logfile', 'pidfile', 'smtp_port',
'email_from', 'smtp_server', 'smtp_user', 'smtp_password',
'db_maxconn', 'import_partial', 'addons_path',
'db_name', 'db_user', 'db_password', 'db_host', 'db_sslmode',
'db_sslrootcert', 'db_port', 'db_template', 'logfile', 'pidfile',
'smtp_port', 'email_from', 'smtp_server', 'smtp_user',
'smtp_password', 'db_maxconn', 'import_partial', 'addons_path',
'xmlrpc', 'syslog', 'without_demo',
'dbfilter', 'log_level', 'log_db',
'log_db_level', 'geoip_database', 'dev_mode', 'shell_interface'
Expand Down