# SSL-connection to localhost Opal fails

**URL:** <https://datashield.discourse.group/t/ssl-connection-to-localhost-opal-fails/693>\
**Category:** Developer support\
**Created:** [1 February 2023 13:20 UTC](https://datashield.discourse.group/t/ssl-connection-to-localhost-opal-fails/693 "2023-02-01T13:20:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aakkoc](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/aakkoc/32/200_2.png) [@aakkoc](https://datashield.discourse.group/u/aakkoc)\
**Post date:** [1 February 2023 13:20 UTC](https://datashield.discourse.group/t/ssl-connection-to-localhost-opal-fails/693/1 "2023-02-01T13:20:52Z")

</div>

Hi, I have installed Opal as a docker image on my localhost. That much worked. But I am struggling to connect to my Opal server over R from the same machine:

Specifically I am getting an SSL-timeout error:

```auto
Logging into the collaborating servers
   [---------------------------------------------------------------------------- Login server [===================================>-------------------------------------] 50% / 0s Error in curl::curl_fetch_memory(url, handle = handle) : 
  Timeout was reached: [localhost:8843] SSL connection timeout

```

For reference, I attach my code in R console for connecting and my docker-compose for Opal installation. Notice that the URL **[https://localhost:8843/](https://localhost:8843/)** matches the port exposed by the docker-compose.

```auto
  ports:
    - "8843:8443" #Ports opal is exposed on
    - "8880:8080" #Ports opal is exposed on

```

R Console:

```auto
install.packages('DSI')
install.packages('DSOpal', dependencies=TRUE)
install.packages('dsBaseClient', repos=c(getOption('repos'), 'http://cran.datashield.org'), dependencies=TRUE)

#load libraries
library(DSI)
library(DSOpal)
library(dsBaseClient)

#Add Log-in Info
builder <- DSI::newDSLoginBuilder()
builder$append(server = "server", url = "https://localhost:8843/",
               user = "administrator", password = "[PASSWORD]", driver = "OpalDriver", options='list(ssl_verifyhost=0, ssl_verifypeer=0)')

#Log-in Command
logindata <- builder$build()
connections <- DSI::datashield.login(logins = logindata, assign = TRUE)
#Log-out Command
DSI::datashield.logout(connections)

```

Docker-Compose:

```auto
version: '3'
services:
  opal:
    platform: linux/x86_64
    image: obiba/opal:4.5 #January 2023
    ports:
      - "8843:8443" #Ports opal is exposed on
      - "8880:8080" #Ports opal is exposed on
    links:
      - rock
      - mongo
      - mysqldata
    environment:
      - JAVA_OPTS=-Xms1G -Xmx8G -XX:+UseG1GC
      - OPAL_ADMINISTRATOR_PASSWORD=[PASSWORD]
      - MONGO_HOST=mongo
      - MONGO_PORT=27017
      - MYSQLDATA_HOST=mysqldata
      - MYSQLDATA_USER=opal
      - MYSQLDATA_PASSWORD=[PASSWORD]
      - ROCK_HOSTS=rock:8085
    volumes:
      - ./vol:/srv #You may want to customize your volume
  mongo:
    platform: linux/x86_64
    image: mongo:4.2
  mysqldata:
    platform: linux/x86_64
    image: mysql:5
    environment:
      - MYSQL_DATABASE=opal
      - MYSQL_ROOT_PASSWORD=[PASSWORD]
      - MYSQL_USER=opal
      - MYSQL_PASSWORD=[PASSWORD]
  rock:
    platform: linux/x86_64
    image: obiba/rock:1.0-R4.2 #Oct 2022

```

---

<div class="post-metadata">

**Author:** ![yannick](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/yannick/32/19_2.png) [@yannick](https://datashield.discourse.group/u/yannick)\
**Post date:** [1 February 2023 14:30 UTC](https://datashield.discourse.group/t/ssl-connection-to-localhost-opal-fails/693/2 "2023-02-01T14:30:33Z")

</div>

Hi,

Have you checked for any CSRF errors in the opal log? (opal\_home/logs/opal.log or download it from Administration \> Java Virtual Machine \> Logs \> Download - Server logs)

By the way, for the `rock` service you should go with the image `datashield/rock-base:6.2-R4.2`. See documentation:

[https://opaldoc.obiba.org/en/latest/cookbook/r-datashield/datashield-profiles.html](https://opaldoc.obiba.org/en/latest/cookbook/r-datashield/datashield-profiles.html)

Regards  
Yannick

---

<div class="post-metadata">

**Author:** ![aakkoc](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/aakkoc/32/200_2.png) [@aakkoc](https://datashield.discourse.group/u/aakkoc)\
**Post date:** [2 February 2023 16:43 UTC](https://datashield.discourse.group/t/ssl-connection-to-localhost-opal-fails/693/3 "2023-02-02T16:43:59Z")

</div>

> [@yannick](#):
>
> By the way, for the `rock` service you should go with the image `datashield/rock-base:6.2-R4.2`. See documentation:

Hi Yannick,

I just re-composed with the rock-base image and after a few hiccups it just worked on the first try. Not sure what went wrong before.

Cheers, Ahmet
