Skip to content
Open
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
6 changes: 2 additions & 4 deletions packages/pg-connection-string/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict'

const { emitWarning } = require('process')

//Parse method copied from https://github.com/brianc/node-postgres
//Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com)
//MIT License
Expand Down Expand Up @@ -213,9 +211,9 @@ function parseIntoClientConfig(str) {
}

function deprecatedSslModeWarning(sslmode) {
if (!deprecatedSslModeWarning.warned) {
if (!deprecatedSslModeWarning.warned && typeof process !== 'undefined' && process.emitWarning) {
deprecatedSslModeWarning.warned = true
emitWarning(`SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'.
process.emitWarning(`SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'.
In the next major version (pg-connection-string v3.0.0 and pg v9.0.0), these modes will adopt standard libpq semantics, which have weaker security guarantees.

To prepare for this change:
Expand Down