Twitter API - Credential Object TLS/SSL Error-error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

Hello R Studio Users
I am using R Studio and trying to connect to the twitter API.
I am using a credential object and passing it along with a cacert.pem file for a handshake with the Twitter API using Twitter Keys.
However I keep getting a SSL routines error message and am unable to proceed further.

I have downloaded the OpenSSL package and loaded the library in my runtime environment, I have also downloaded RCurl and baseenc64 packages along with twitteR package.
However I keep getting this TLS v1/SSL routine error.

This is the code I am using>

credential<-OAuthFactory$new(consumerKey="xxxxx",
consumerSecret="xxxxx",
requestURL="xxhttps://api.twitter.com/oauth/request_token",
accessURL="xxhttps://api.twitter.com/oauth/access_token",
authURL="xxhttps://api.twitter.com/oauth/authorize")

credential$handshake()
registerTwitterOAuth(credential)

Error:

credential$handshake(cainfo="cacert.pem")
Error in function (type, msg, asError = TRUE) :
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

I am using a Windows 10 machine with no proxy server connection to Internet.
I have checked internet options to enable TLS 1.0, 1.1, 1.2.

Here is my session info.

> sessioninfo::session_info()
- Session info --------------------------------------------------------------------
setting value
version R version 4.0.2 (2020-06-22)
os Windows 10 x64 (build 19043)
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United States.1252
ctype English_United States.1252
tz America/New_York
date 2022-03-18
rstudio 2022.02.0+443 Prairie Trillium (desktop)
pandoc NA

- Packages ------------------------------------------------------------------------
package * version date (UTC) lib source
askpass 1.1 2019-01-13 [1] CRAN (R 4.0.5)
base64enc * 0.1-3 2015-07-28 [1] CRAN (R 4.0.3)
bit 4.0.4 2020-08-04 [1] CRAN (R 4.0.5)
bit64 4.0.5 2020-08-30 [1] CRAN (R 4.0.5)
bitops 1.0-7 2021-04-24 [1] CRAN (R 4.0.5)
cli 3.2.0 2022-02-14 [1] CRAN (R 4.0.5)
curl * 4.3.2 2021-06-23 [1] CRAN (R 4.0.5)
DBI 1.1.2 2021-12-20 [1] CRAN (R 4.0.5)
digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.2)
httr 1.4.2 2020-07-20 [1] CRAN (R 4.0.5)
openssl * 2.0.0 2022-03-02 [1] CRAN (R 4.0.5)
R6 2.5.1 2021-08-19 [1] CRAN (R 4.0.5)
RCurl 1.98-1.6 2022-02-08 [1] CRAN (R 4.0.5)
rjson 0.2.21 2022-01-09 [1] CRAN (R 4.0.5)
ROAuth * 0.9.6 2015-02-13 [1] CRAN (R 4.0.5)
sessioninfo * 1.2.2 2021-12-06 [1] CRAN (R 4.0.5)
twitteR * 1.1.9 2015-07-29 [1] CRAN (R 4.0.5)

[1] C:/Users/Home 2/Documents/R/win-library/4.0
[2] C:/Program Files/R/R-4.0.2/library

Please let me know if you can resolve this as I am unable to proceed.
I have also tried on different machines but the same TLS / SSL error.

Thank you
Rohan Purohit

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.