KxSystems / rkdb

R client for kdb+
https://code.kx.com/q/interfaces
Apache License 2.0
41 stars 29 forks source link

Unable to connect with TLS - something about an incompatible ssl version #65

Closed travis-leith closed 9 months ago

travis-leith commented 2 years ago

If I try to open a connection I get OpenSSL initialisation error.

If I run sslinfo() I get

Error in sslinfo() : 
  kdb+ : Could not initialize openssl. Error was incompatible ssl version
.

I am using the latest version of openssl, according to the website linked from the KX ssl instructions. OpenSSL 1.1.1l 24 Aug 2021

This same website tells me to punch myself in the face if I want to use an older version of openssl ;)

jhanna-kx commented 2 years ago

Hi travis, this is due to an older version of the client library being included in this repository (which does not support openssl 1.1.1). There is a PR open to address this #66 . In the mean time if you have a local clone of the rkdb repo you can workaround by updating the version of the client library (w64/e_static.lib) using the latest version at

https://github.com/KxSystems/kdb/raw/master/w64/e_static.lib

And rebuild/reinstall the rkdb package in R with

devtools::install_local('PATHTOLOCALCLONE',quiet=TRUE,force=TRUE,INSTALL_opts=c("--no-multiarch"))
travis-leith commented 2 years ago

@jhanna-kx is there any particular reason why the PR has not been merged? Can I consider this fit for production use?

statquant commented 2 years ago

Looks like this repo has not been updated for years?

travis-leith commented 2 years ago

@jhanna-kx this used to work for me, but now when I try to do it I get the following:

* installing source package 'rkdb' ... using staged installation libs gcc -I"C:/PROGRA\~1/R/R-42\~1.0/include" -DNDEBUG -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -D_GNU_SOURCE -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c rkdb.c -o rkdb.o In file included from rkdb.c:15: common.c: In function 'from_guid_kobject': k.h:31:19: warning: passing argument 1 of 'guid_2_char' from incompatible pointer type [-Wincompatible-pointer-types] 31 #define kG(x) ((x)->G0) ~~^~~
G {aka unsigned char }
k.h:31:19: note: in definition of macro 'kG' 31 #define kG(x) ((x)->G0) ^~ In file included from rkdb.c:20: common.c:116:22: note: expected 'K' {aka 'struct k0 '} but argument is of type 'G ' {aka 'unsigned char *'} 116 static K guid_2_char(K); ^ common.c:264:20: warning: passing argument 1 of 'guid_2_char' from incompatible pointer type [-Wincompatible-pointer-types] 264 y= guid_2_char((G*)(&kU(x)[i])); ^~~~~~~
G {aka unsigned char }
common.c:116:22: note: expected 'K' {aka 'struct k0 '} but argument is of type 'G ' {aka 'unsigned char *'} 116 static K guid_2_char(K); ^ In file included from rkdb.c:15: k.h:31:19: warning: pointer targets in passing argument 1 of 'kp' differ in signedness [-Wpointer-sign] 31 #define kG(x) ((x)->G0) ~~^~~
G {aka unsigned char }
k.h:31:19: note: in definition of macro 'kG' 31 #define kG(x) ((x)->G0) ^~ common.c:265:18: note: in expansion of macro 'kC' 265 kK(z)[i]= kp(kC(y)); ^~ k.h:76:17: note: expected 'S' {aka 'char '} but argument is of type 'G ' {aka 'unsigned char *'} 76 knk(I,...),kp(S),ja(K,V),js(K,S),jk(K,K),jv(K*k,K),k(I,const S,...),xT(K),xD(K,K),ktd(K),r1(K),krr(const S),orr(const S),dot(K,K),b9(I,K),d9(K),sslInfo(K x); ^ In file included from rkdb.c:20: common.c: In function 'guid_2_char': common.c:468:11: warning: initialization of 'G ' {aka 'unsigned char '} from incompatible pointer type 'K' {aka 'struct k0 *'} [-Wincompatible-pointer-types] 468 G*gv= x; ^ In file included from rkdb.c:15: k.h:31:19: warning: pointer targets in passing argument 1 of 'sprintf' differ in signedness [-Wpointer-sign] 31 #define kG(x) ((x)->G0) ~~^~~
G {aka unsigned char }

k.h:31:19: note: in definition of macro 'kG' 31 | #define kG(x) ((x)->G0) | ^~ common.c:469:13: note: in expansion of macro 'kC' 469 | sprintf(kC(y),"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",gv[ 0],gv[ 1],gv[ 2],gv[ 3],gv[ 4],gv[ 5],gv[ 6],gv[ 7],gv[ 8],gv[ 9],gv[10],gv[11],gv[12],gv[13],gv[14],gv[15]); | ^~ In file included from C:/PROGRA\~1/R/R-42\~1.0/include/R.h:45, from rkdb.c:7: c:\rtools42\x86_64-w64-mingw32.static.posix\include\stdio.h:396:20: note: expected 'char ' but argument is of type 'G ' {aka 'unsigned char '} 396 | int sprintf (char stream, const char *format, ...) | ~~^~~~ gcc -shared -s -static-libgcc -o rkdb.dll tmp.def rkdb.o -Lw64 -le_static -lws2_32 -liphlpapi -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools42/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-42~1.0/bin/x64 -lR Warning: corrupt .drectve at end of def file Warning: corrupt .drectve at end of def file C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: w64/e_static.lib(e.obj):(.text[app_stdin]+0x3): undefined reference to `imp_iob_func' C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: w64/e_static.lib(e.obj):(.text[app_stdout]+0x6): undefined reference to `imp_iob_func' C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: w64/e_static.lib(e.obj):(.text[app_stderr]+0x6): undefined reference to `imp___iob_func' C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: w64/e_static.lib(e.obj):(.text[sslrr]+0x85): undefined reference to `imp__snprintf' C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: w64/e_static.lib(c.obj):(.text[vkrr]+0xb9): undefined reference to `_snprintf' collect2.exe: error: ld returned 1 exit status no DLL was created ERROR: compilation failed for package 'rkdb' * removing 'C:/azrepos/Adia.Quatro.Ui/ShinyUi/renv/library/R-4.2/x8664-w64-mingw32/rkdb' Warning message: In i.p(...) : installation of package ‘C:/Users/LOCAL~1/Temp/Rtmp2j3xIE/file6aa866e24d91/rkdb_0.12.0.tar.gz’ had non-zero exit status