opendiffy/diffy

The setting for service.protocol option may is not in effect

fengguangke opened this issue · 3 comments

i set the value of the service.protocol option to "https":

docker run --env OTEL_JAVAAGENT_ENABLED=false -d --name diffy-01 \
  -p 8880:8880 -p 8888:8888 \
  diffy/diffy  env \
    --candidate=lambda-api.sn126.com:443 \
    --master.primary=lambda-api.sn126.com:443 \
    --master.secondary=lambda-api.sn126.com:443 \
    --allowHttpSideEffects=true \
    --responseMode=primary \
    --service.protocol=https \
    --serviceName="Example Service" \
    --proxy.port=8880 \
    --http.port=8888 \
    --rootUrl=localhost:8888

but the settings value in Diffy UI is also "http"

image

and when i send https request, the resonse retures:

 body=<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
</body>
</html>

For https requests, please just include the protocol in the base urls. e.g. https://yourdomain.com/basePathPrefix

Hi @puneetkhanduri, am I missing anything here?

java -jar diffy.jar -candidate='qa-chatbot-configurations-api.aws.phenom.local:80' -master.primary='qa-chatbot-configurations-api.aws.phenom.local:80' -master.secondary='qa-chatbot-configurations-api.aws.phenom.local:80' -service.protocol='http' -serviceName='My-Service' -proxy.port=:31900 -admin.port=:8881 -http.port=:8888 -rootUrl='localhost:8889'

The issue is even if I am passing these the jar file is not honoring it. can you please check once.

zhlu32 commented

i set the value of the service.protocol option to "https":

docker run --env OTEL_JAVAAGENT_ENABLED=false -d --name diffy-01 \
  -p 8880:8880 -p 8888:8888 \
  diffy/diffy  env \
    --candidate=lambda-api.sn126.com:443 \
    --master.primary=lambda-api.sn126.com:443 \
    --master.secondary=lambda-api.sn126.com:443 \
    --allowHttpSideEffects=true \
    --responseMode=primary \
    --service.protocol=https \
    --serviceName="Example Service" \
    --proxy.port=8880 \
    --http.port=8888 \
    --rootUrl=localhost:8888

but the settings value in Diffy UI is also "http"

image

and when i send https request, the resonse retures:

 body=<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
</body>
</html>

May Diffy not support https traffic proxy? @puneetkhanduri

I didn't find any paramters to set https certificate, like:
--proxy.sslPort=8443
--proxy.keystorePath=/path/to/your/keystore.jks
--proxy.keystorePassword=your_keystore_password
--proxy.keyPassword=your_key_password \