title: Accessing FTPS using RCurl
body: <p>I have an FTPS server which I can already work with using clients such as Filezilla and Syncback. I also have admin access to this FTPS server and I know that it is working properly with TLS because I see "TLS" in the Filezilla connection log.</p>
  
  <p>I cannot, however, access this same FTPS server from R using the RCurl library (R version=3.4.3, RCurl version = 1.95-4.9, windows 7 PC). I expect it has something to do with my invocation of getURL(). Here's what happens when I try to list the files in a directory on the FTPS server:</p>
  
  <pre><code>library(RCurl)
  url       &lt;- "FTPS://&lt;myIpaddress&gt;/&lt;path&gt;/"
  userpwd   &lt;- "myname:mypasswd"
  filenames &lt;- getURL(url, userpwd=userpwd, ftp.use.epsv = FALSE, dirlistonly = TRUE, .opts=curlOptions(verbose=TRUE))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6hqk5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6hqk5.png" alt="first attempt: connection refused on port 990"></a></p>
  
  <p>It complains about connection refused on port 990 (presumably the default port for FTPS?). I happen to have the FTPS server setup to use port 21. Filezilla didn't require a port number so I had left it out here too. Explicitly specifying port 21, however, gives another problem...</p>
  
  <pre><code>url &lt;- "FTPS://&lt;myIpaddress&gt;:21/&lt;path&gt;/"
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/CToMg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/CToMg.png" alt="second attempt: unknown protocol"></a></p>
  
  <p>This time the complaint is about "unknown protocol". Don't understand. I am using a FTPS server listening on port 21, I specify the same on the URL. What could be wrong? </p>
  
  <p>Can anyone recommend some ways to troubleshoot this further? </p>
  
  <p>For completeness here's the FTPS server configuration (it's a synology diskstation NAS)...
  <a href="https://i.stack.imgur.com/Of1Ig.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Of1Ig.png" alt="enter image description here"></a></p>