2

I am trying to get some data in json format in using RCurl.

I have to use POST to enter the username and password such as:

postForm(url1, user=x$USERNAME, pass=x$PASSWORD)

I get the following error:

Error in function (type, msg, asError = TRUE)  : 

SSL read: error:00000000:lib(0):func(0):reason(0), errno 54

If I researched the correct error number 54 from the libcurl site:

CURLE_SSL_ENGINE_SETFAILED (54)

Failed setting the selected SSL crypto engine as default!

If this is the correct error how would I select the SSL engine?

Kevin
  • 1,112
  • 2
  • 15
  • 29

1 Answers1

8

Sorry, but the conclusion about this error is wrong. The output you see is from lib/ssluse.c in libcurl's source code and the "errno" mentioned there is not the libcurl error code but the actual errno variable at that time. I'm not sure what help we can get by knowing it, but 54 in my system equals EXFULL.

You should rather check the return code from the libcurl function that fails to get the proper libcurl error code but I guess you might see CURLE_RECV_ERROR simply because libcurl got tis SSL problem when receiving data.

Unfortunately that error string from openssl is not very helpful and I can't tell why you got it!

Daniel Stenberg
  • 54,736
  • 17
  • 146
  • 222
  • Isn't errno 54 "connection reset by peer" ECONNRESET on most POSIX systems? At least it is on Mac OSX, FreeBSD and Linux. – CXJ Apr 20 '17 at 20:19
  • 1
    On Linux: /usr/include/asm-generic/errno.h:#define ECONNRESET 104 /* Connection reset by peer */ – Daniel Stenberg Apr 20 '17 at 20:27
  • Wow, that's not very convenient or helpful, is it? – CXJ Apr 20 '17 at 22:53
  • I just wanted to show that ECONNRESET, contrary to what you wrote, is actually 104 on Linux (and on mac in fact). Helpful? Not really since the errno in the question was 54. – Daniel Stenberg Apr 21 '17 at 07:44
  • 1
    Straight out of /usr/include/sys/errno.h on my Mac: #define ECONNRESET 54 /* Connection reset by peer */ – CXJ Apr 24 '17 at 20:55
  • Meh. SO wouldn't let me finish my edit. It said: My remark about convenient/helpful is the OS programmers choosing differing values for the same historic constant, not about your answer or comment. Straight out of /usr/include/sys/errno.h on my Mac: #define ECONNRESET 54 /* Connection reset by peer */ Maybe Apple changed it between versions. Same on the multiple FreeBSD hosts we run as servers. Actually, here's a semi-useful reference: http://www.ioplex.com/~miallen/errcmp.html – CXJ Apr 24 '17 at 21:03