Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fcli sc-dast sensor disable : host unknow but user is able to ping the host #212

Closed
james-du1 opened this issue Dec 21, 2022 · 1 comment

Comments

@james-du1
Copy link

fcli sc-dast sensor disable : host unknow but user is able to ping the host
note: also have tried on VM which should be able to connect without configuring the host, but same error

image

@rsenden
Copy link
Contributor

rsenden commented Dec 22, 2022

I experienced this issue before as well, but was hoping that it was an environmental issue. It took a lot of debugging effort to resolve this issue as it was caused by some hidden characters (probably copied from the Swagger page) that were not displayed by my IDE. Only after printing out the byte values for a known working host name allowed me to identify this issue.

Working host name:
115 99 100 97 115 116 97 112 105 46 117 97 116 46 102 111 114 116 105 102 121 104 111 115 116 101 100 46 110 101 116

UnknownHostException (notice the 3 extra negative values at the end):
115 99 100 97 115 116 97 112 105 46 117 97 116 46 102 111 114 116 105 102 121 104 111 115 116 101 100 46 110 101 116 -30 -128 -117 

Even more confusing was that these extra characters didn't come from the hostname itself (i.e. the host name stored in the session), but from the endpoint URI that is being appended to the base URL:

unirest.post("<hidden chars>/api/v2/scanners/{id}/set-scanner-enabled-value")

Being before the first slash, Unirest/Apache HTTP Client considered these hidden characters specified in the endpoint URI to be part of the host name.

@github-actions github-actions bot mentioned this issue Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants