0

I'm working on Dockerizing a legacy Laravel app. I have Traefik set up, as can be seen by the yml file. The guy who built it for the company I just joined is long gone and I know very little about the framework.

The project has two apps, web and services. The web needs to access the services to login and get the jwt token. The web app runs the login page, but when the submit button is hit, it goes to an incredibly unhelpful error screen that says UnauthorizedHTTPException and points me to the tymon BaseMiddleware.php and a function that goes down through multiple levels. I think digging down is futile though because I think this has to be a configuration issue, but I can't figure it out. The error I'm getting in the Laravel logs is just one line:

local1.ERROR: Unhandled Exception: cURL error 35: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Edit

The php.ini setup doesn't enter into the issue as I'm able to duplicate on the command line. Sorry should have had that in my original post. ;-)

I have talked with a Docker Captain. He is pretty sure the stopper is that the server doesn't have the proper creds. But that is by design for Docker and how it's supposed to be deployed. All communication between containers is supposed to be http. If further encryption is desired, then you encrypt the network links. So my question is dealing directly with setting up Laravel to obey.

End Edit

Anyone able to point me in the right direction? Here are the .env and docker-compose.yml files.

APP_NAME="LendPro Web"
APP_ENV=local1
APP_KEY=base64:{supersecret}
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://utpweb.mylendpro.com/

SESSION_ENCRYPT=false

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379


PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=

JWT_SECRET={supersecret}
JWT_COOKIE_TTL=1440

UTPS_URL=utpservices  <--- This is the call to the api server. 

Docker-Compose.yml

version: '3.7'

services:
    utpweb:
        container_name: utpweb
        build:
            context: .
            dockerfile: .docker/utpweb.dockerfile  
            args:
                appPath: utp-web
        image: utpweb-image      

        expose:
            - 80
            - 443
        volumes:
            - ./:/var/www/utp-web/
        networks:
            - lendDocNet
            - traefik
        labels:
          - traefik.frontend.rule=Host:utpweb.mylendpro.com
          - traefik.port=80
          - traefik.docker.network=traefik
          - traefik.backend=utpweb

networks:
    lendDocNet:
        external: true
    traefik:
        external: true
  • The error contains an URL, which describes the error further. Go to http://curl.haxx.se/libcurl/c/libcurl-errors.html and scroll down to 35. – common sense Feb 13 '19 at 04:32
  • Can you verify curl is installed and activated in php.ini? – Adlan Arif Zakaria Feb 13 '19 at 07:56
  • Googling the cURL error itself turns up [some answers here on SO](https://stackoverflow.com/questions/21619468/curl-returns-unknown-protocol), do they help? What is the URL it is calling, and where is it set up? – Don't Panic Feb 13 '19 at 10:26
  • Please check my comments for responses to these first three questions. – Michael Eves Shaffer Feb 13 '19 at 13:22
  • The error you are seeing is pretty clear (`unknown protocol`), and it doesn't seem to be related to credentials. I'd try tracing where your URL (`utpservices`?) is used, if it should be fully qualified, if it is being called with https, http, something else ... – Don't Panic Feb 13 '19 at 17:15

0 Answers0