Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

OpenSSL::SSL::SSLError: could not stablish connection: SSL error. #1660

@Nols1000

Description

@Nols1000

Hi,

I'm using portus and Registry/Distribution on a Docker-Swarm (currently just 1 node) and behind a Docker Flow Proxy (HAProxy). The Registry runs at port 443 with a certificated signed with my own CA. Portus runs at port 443 and subRoot '/portus'.

When I try to setup the connection of the Registry and Portus it fails with "OpenSSL::SSL::SSLError: could not stablish connection: SSL error. You can skip this check by clicking on the "Skip remote checks" checkbox.".

Response of /portus/api/v1/registries/validate?name=Local+Registry&hostname=docker-registry01.local&external_hostname=&use_ssl=true&force=false&only%5B%5D=hostname:

{"messages":{"hostname":["OpenSSL::SSL::SSLError: could not stablish connection: SSL error."]},"valid":false}

Docker-Compose File

version: '3'

services:
  redis:
    image: redis:alpine
    command: redis-server /etc/redis/config.conf
    networks:
      - default
    volumes:
      - ./config/redis/config.conf:/etc/redis/config.conf

  registry:
    image: registry:2
    depends_on:
      - redis
    networks:
      - default
      - proxy
    ports:
      - 5000
    environment:
      - REGISTRY_AUTH_TOKEN_REALM=https://docker-registry01.local/portus/v2/token
      - REGISTRY_AUTH_TOKEN_SERVICE=docker-registry01.local
      - REGISTRY_AUTH_TOKEN_ISSUER=docker-registry01.local
      - REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE=/etc/ssl/certs/docker-registry01.local.crt
      - REGISTRY_HTTP_SECRET=****
      - REGISTRY_REDIS_ADDR=redis:6379
      - REGISTRY_STORAGE_DELETE_ENABLED=true
      - REGISTRY_STORAGE_CACHE_BLOBDESCRIPTOR=redis
    volumes:
      - ./data/registry:/var/lib/registry
      - /etc/ssl/certs:/etc/ssl/certs:ro
      - ./config/registry/config.yml:/etc/docker/registry/config.yml
    deploy:
      replicas: 1
      labels:
        - com.df.notify=true
        - com.df.port=5000
        - com.df.serviceDomain=docker-registry01.local

  mariadb:
    image: library/mariadb:10.0.23
    networks:
      - default
    ports:
      - 3306
    environment:
      MYSQL_ROOT_PASSWORD: ****
    volumes:
      - ./data/mysql:/var/lib/mysql

  portus:
    image: opensuse/portus:2.3
    depends_on:
      - mariadb
    networks:
      - default
      - proxy
    ports:
      - 3000
    environment:
      RAILS_SERVE_STATIC_FILES: 'true'
      RAILS_RELATIVE_URL_ROOT: /portus
      PORTUS_DB_HOST: mariadb
      PORTUS_DB_USERNAME: ****
      PORTUS_DB_PASSWORD: ****
      PORTUS_DB_DATABASE: ****
      PORTUS_DELETE_ENABLED: 'true'
      PORTUS_MACHINE_FQDN_VALUE: docker-registry01.local
      PORTUS_CHECK_SSL_USAGE_ENABLED: 'false'
      PORTUS_SECRET_KEY_BASE: ****
      PORTUS_KEY_PATH: /certificates/docker-registry01.local.key
      PORTUS_PASSWORD: ****
      PORTUS_SIGNUP_ENABLED: 'false'
    volumes:
      - ./config/portus:/etc/portus
      - ./secrets:/certificates:ro
    deploy:
      replicas: 1
      labels:
        - com.df.notify=true
        - com.df.port=3000
        - com.df.servicePath=/portus
        - com.df.serviceDomain=docker-registry01.local

#  portus-background:
#    image: opensuse/portus:latest
#    entrypoint: bundle exec rails runner /svr/Portus/bin/background.rb
#    networks:
#      - default
#    depends_on:
#      - portus
#      - mariadb
#    environment:
#      - PORTUS_DB_HOST=mariadb
#      - PORTUS_DB_USERNAME=****
#      - PORTUS_DB_PASSWORD=****
#      - PORTUS_DB_DATABASE=****


networks:
  default:
    external: false
  proxy:
    external: true

Portus Logs (NOTE PORTUS_LOG_LEVEL: debug does not provide more relevant information):

Started GET "/portus/admin/registries/1/edit" for 10.0.0.10 at 2018-02-06 17:01:12 +0000
Processing by Admin::RegistriesController#edit as HTML
  Parameters: {"id"=>"1"}
  Rendered admin/registries/components/_form.html.slim (2.7ms)
  Rendered admin/registries/edit.html.slim within layouts/application (3.3ms)
  Rendered shared/_header.html.slim (0.9ms)
  Rendered shared/_aside.html.slim (0.7ms)
  Rendered shared/_search.html.slim (0.2ms)
  Rendered shared/_notification.html.slim (0.1ms)
  Rendered shared/_notifications.html.slim (0.2ms)
Completed 200 OK in 12ms (Views: 7.8ms | ActiveRecord: 0.9ms)
Started GET "/portus/api/v1/registries/validate?name=Local+Registry&hostname=doc&external_hostname=&use_ssl=false&force=false&only%5B%5D=hostname" for 10.0.0.10 at 2018-02-06 17:01:17 +0000
SocketError: connection refused.
Started GET "/portus/api/v1/registries/validate?name=Local+Registry&hostname=do&external_hostname=&use_ssl=false&force=false&only%5B%5D=hostname" for 10.0.0.10 at 2018-02-06 17:01:18 +0000
SocketError: connection refused.
Started GET "/portus/api/v1/registries/validate?name=Local+Registry&hostname=docke&external_hostname=&use_ssl=false&force=false&only%5B%5D=hostname" for 10.0.0.10 at 2018-02-06 17:01:20 +0000
SocketError: connection refused.
Started GET "/portus/api/v1/registries/validate?name=Local+Registry&hostname=docker-registry01.local&external_hostname=&use_ssl=false&force=false&only%5B%5D=hostname" for 10.0.0.10 at 2018-02-06 17:01:23 +0000
Started GET "/portus/api/v1/registries/validate?name=Local+Registry&hostname=docker-registry01.local&external_hostname=&use_ssl=true&force=false&only%5B%5D=hostname" for 10.0.0.10 at 2018-02-06 17:01:25 +0000
OpenSSL::SSL::SSLError: could not stablish connection: SSL error.

Portus Information:

[Mailer config] Host:     portus.test.lan
[Mailer config] Protocol: https://
Evaluated configuration:
---
email:
  from: [email protected]
  name: Portus
  reply_to: [email protected]
  smtp:
    enabled: false
    address: smtp.example.com
    port: 587
    user_name: [email protected]
    password: "****"
    domain: example.com
gravatar:
  enabled: true
delete:
  enabled: true
ldap:
  enabled: false
  hostname: ldap_hostname
  port: 389
  method: plain
  base: ''
  filter: ''
  uid: uid
  authentication:
    enabled: false
    bind_dn: ''
    password: "****"
  guess_email:
    enabled: false
    attr: ''
oauth:
  google_oauth2:
    enabled: false
    id: ''
    secret: ''
    domain: ''
    options:
      hd: ''
  open_id:
    enabled: false
    identifier: ''
    domain: ''
  github:
    enabled: false
    client_id: ''
    client_secret: ''
    organization: ''
    team: ''
    domain: ''
  gitlab:
    enabled: false
    application_id: ''
    secret: ''
    group: ''
    domain: ''
    server: ''
  bitbucket:
    enabled: false
    key: ''
    secret: ''
    domain: ''
    options:
      team: ''
first_user_admin:
  enabled: true
signup:
  enabled: false
check_ssl_usage:
  enabled: false
registry:
  jwt_expiration_time:
    value: 5
  catalog_page:
    value: 100
  timeout:
    value: 2
  read_timeout:
    value: 120
machine_fqdn:
  value: docker-registry01.local
display_name:
  enabled: false
user_permission:
  change_visibility:
    enabled: true
  create_team:
    enabled: true
  manage_team:
    enabled: true
  create_namespace:
    enabled: true
  manage_namespace:
    enabled: true
security:
  clair:
    server: ''
    health_port: 6061
  zypper:
    server: ''
  dummy:
    server: ''
anonymous_browsing:
  enabled: true

Portus version: 2.3.0@6c27eb83e3b23b12ce62d39e6823ec8cf5747921

NOTE: I've replaced my domain name with docker-registry01.local.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions