Skip to main content
gfragkos
Silver ⭐️⭐️⭐️
April 28, 2022
Question

R client connections fails with CDP Impala

I am having trouble with the Impala connection from R with the following error:

 

'Error: nanodbc/nanodbc.cpp:983: 00000: [unixODBC][Cloudera][DriverSupport] (1100) SSL certificate verification failed because the certificate is missing or incorrect.'

 

Here is the connection details in our code:

 

impala = src_impala(

     drv = drv,

     driver = "/opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.so",

     host = "cdp-tdh-de3-master0.cdp-tdh.u5te-1stu.cloudera.site",

     database = db,

     port = 21050,

     uid = username,

     pwd = password,

     AuthMech = 3,

     transportMode="http",

     httpPath="cdp-tdh-de3/cdp-proxy-api/impala",

     ssl = 1,

    sslTrustStore="/home/csso_innovation.cdh/gateway-client-trust.jks"

)

return(impala)

 

Any help is appreciated.

Thanks,

Gozde

11 replies

mszurap
Platinum ⭐️
Platinum ⭐️
April 28, 2022

Hello Gozde @gfragkos ,

Have you checked whether the connectivity works with the given sslTrustStore file with a Java based client? (for example with beeline)

As I see your application tries to use unixODBC to connect to a CDP / Impala service. However from the shared connection details I see that the truststore is a Java keystore file (JKS), and since the "nanodbc.cpp" is not a Java based application, it probably cannot recognize that as a valid truststore file. Please try to use a "pem" format trustrstore file instead.

 

Please also review the Impala ODBC Driver documentation:

https://downloads.cloudera.com/connectors/impala_odbc_2.6.14.1016/Cloudera-ODBC-Connector-for-Impala-Install-Guide.pdf

 

Thanks

 Miklos

Translate
gfragkos
gfragkosAuthor
Silver ⭐️⭐️⭐️
May 2, 2022

Hi Miklos,

 

Thanks a lot for your message.

I edited the code as follows and tried again but it gives the same error. Do you think there is something missing or wrong in the code below?

 

drv = odbc::odbc()

impala = src_impala(
drv = drv,
driver = "/opt/cloudera/impalaodbc/lib/64/libclouderaimpalaodbc64.so",
host = "cdp-tdh-de3-master0.cdp-tdh.u5te-1stu.cloudera.site",
database = db,
port = 21050,
uid = username,
pwd = password,
KrbRealm = "",
KrbFQDN = "",
KrbServiceName = "impala",
AuthMech = 3,
ssl = 1,
sslTrustStore="/var/lib/cloudera-scm-agent/agent-cert/cm-auto-global_cacerts.pem"
)
return(impala)

 

Thanks a lot,

Gozde

 

Translate
gfragkos
gfragkosAuthor
Silver ⭐️⭐️⭐️
May 3, 2022

Hi @mszurap,

Thanks again for your message. While not understanding it very much, I think it is enabled. I see an output like the following:

CONNECTED(00000003)
depth=2 O = CDP-TDH.U5TE-1STU.CLOUDERA.SITE, CN = Certificate Authority
verify return:1
depth=1 CN = cdp-tdh-de3-master0
verify return:1
depth=0 C = US, ST = CA, CN = cdp-tdh-de3-master0.cdp-tdh.u5te-1stu.cloudera.site
verify return:1
---
Certificate chain
0 s:/C=US/ST=CA/CN=cdp-tdh-de3-master0.cdp-tdh.u5te-1stu.cloudera.site
i:/CN=cdp-tdh-de3-master0
1 s:/CN=cdp-tdh-de3-master0
i:/O=CDP-TDH.U5TE-1STU.CLOUDERA.SITE/CN=Certificate Authority
2 s:/O=CDP-TDH.U5TE-1STU.CLOUDERA.SITE/CN=Certificate Authority
i:/O=CDP-TDH.U5TE-1STU.CLOUDERA.SITE/CN=Certificate Authority
---
Server certificate

----begin certificate

....

----end certificate

No client certificate CA names sent
---
SSL handshake has read 3743 bytes and written 735 bytes
---
New, TLSv1/SSLv3, Cipher is AES256-GCM-SHA384
Server public key is 3072 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : ....
Session-ID: ....
Session-ID-ctx:
Master-Key: ....
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
TLS session ticket lifetime hint: 300 (seconds)
TLS session ticket:
0000 - bf 32 96 28 05 ee 1f 7a-d5 f9 54 27 ab 86 9d 0e .2.(...z..T'....
0010 - b0 0b f9 43 99 1d f6 8d-9b 0e ec 26 25 95 8d 5c ...C.......&%..\
0020 - 39 ed 4b 81 59 28 6a 11-59 71 b0 c4 41 55 fa 22 9.K.Y(j.Yq..AU."
0030 - 3c 3f e7 33 ae e6 a0 79-d7 64 a5 20 10 bd 45 da <?.3...y.d. ..E.
0040 - ef af 1d 8a 4a af 86 a7-04 61 55 d0 6b f8 1d c4 ....J....aU.k...
0050 - a0 d5 8d c1 b2 94 ad b0-b9 b8 c7 29 a3 43 e7 a4 ...........).C..
0060 - 7f 71 60 05 27 3f 3b b3-50 74 b6 57 54 b5 0a ab .q`.'?;.Pt.WT...
0070 - 5e 3f f5 d3 62 91 88 35-f6 c9 a4 3a 51 b5 f9 12 ^?..b..5...:Q...
0080 - 37 99 49 aa 06 80 c0 9f-23 67 93 fd 6b 45 8f 74 7.I.....#g..kE.t
0090 - 3a 2d f5 e1 0a e3 ea 41-f2 8a 48 ec ac 21 c8 84 :-.....A..H..!..

Start Time: 1651561803
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
DONE

 

Translate