Inhalte aufrufen

Profilbild

SSL required

SSL

Best Answer malaga , 10 April 2024 - 12:03

Setting the env variable ASPNETCORE_ENVIRONMENT  to development solved the problem. Many thanks Marcus!

Go to the full post


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
3 Antworten zu diesem Thema

#1 malaga

malaga

    Newbie

  • Members
  • Punkt
  • 3 Beiträge

Geschrieben: 08 April 2024 - 10:05

Hi,

 

for testing purposes I am running the store on the localhost from a docker container. The SSL required in the store settings is deactivated. Nevertheless, with the GET request from the endpoint http://localhost:9280/odata/v1/orders I get the error: 

{
"error": {
"code": "421",
"message": "Access to the Web API was denied. Reason: SslRequired. Web API requests require SSL. User agent: Java-http-client/17.0.9",
"target": "",
"details": {},
"innererror": {}
}
}

 I also tried to get all orders via SwaggerUI and am getting the same error. I used the public key as a username and the private key as a password.

 

Has anyone experienced this issue and how can I solve it?

 

Many thanks!

 



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3802 Beiträge

Geschrieben: 08 April 2024 - 12:22

The SSL requirement is determined via CommonHelper.IsDevEnvironment and this is probably "False" via a docker container.
 
For development purposes, you will have to try it without a docker container or provide a valid SSL certificate for localhost:9280.

Marcus Gesing

Smartstore AG


#3 malaga

malaga

    Newbie

  • Members
  • Punkt
  • 3 Beiträge

Geschrieben: 09 April 2024 - 08:28

Hi Marcus,

 

many thanks for your answer. Actually the dev env is set to true in the docker container:
 

"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"IsDevEnvironment=true",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"ASPNETCORE_URLS=http://+:80;https://+:443",
"DOTNET_RUNNING_IN_CONTAINER=true",
"DOTNET_VERSION=7.0.15",
"ASPNET_VERSION=7.0.15"
],
"Cmd": null,
"Image": "ghcr.io/smartstore/smartstore-linux",
"Volumes": null
 
Also in the DB in table Setting the sslOnLocalhost is set to false
 
 
So why is it still needed?


#4 malaga

malaga

    Newbie

  • Members
  • Punkt
  • 3 Beiträge

Geschrieben: 10 April 2024 - 12:03   Best Answer

Setting the env variable ASPNETCORE_ENVIRONMENT  to development solved the problem. Many thanks Marcus!


  • Marcus Gesing gefällt das


Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: SSL