使用 R 通过 SSL 连接到 Postgres [英] Connect to Postgres via SSL using R

查看:29
本文介绍了使用 R 通过 SSL 连接到 Postgres的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有同样的问题,在这里被问到 连接到Redshift 通过 SSL 使用 R

I have the same question that was asked here Connect to Redshift via SSL using R

但是,给出的答案需要证书验证.我想知道是否有办法在没有证书验证的情况下做到这一点?当我通过 sql 客户端连接时,我只需添加这个

However, the answer given requires certificate validation. I'm wondering if there is a way to do this without certificate validation? When I connect via a sql client, I just add this

?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory

如何在 R 中添加这些参数?

How can I add these parameters in R?

在此先感谢您的帮助!

推荐答案

与其将 verify-full 传递给 sslmode,不如尝试 require允许:

Instead of passing verify-full to sslmode, try require or allow:

dbConnect(dbDriver('PostgreSQL'),
    dbname   = 'dbname=foobar sslmode=require',
    host     = 'foobar.redshift.amazonaws.com',
    port     = 5439,
    user     = 'foobar',
    password = 'foobar')

这篇关于使用 R 通过 SSL 连接到 Postgres的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆