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

CERTIFICATE_VERIFY_FAILED #11

Closed
Snazzie opened this issue Apr 4, 2023 · 21 comments
Closed

CERTIFICATE_VERIFY_FAILED #11

Snazzie opened this issue Apr 4, 2023 · 21 comments

Comments

@Snazzie
Copy link

Snazzie commented Apr 4, 2023

Steps:

  1. Launch A111
  2. do a text2img generate
  3. see error

image

@papuSpartan
Copy link
Owner

papuSpartan commented Apr 4, 2023

I'm aware of this issue and will be looking at it this afternoon.

@papuSpartan papuSpartan pinned this issue Apr 4, 2023
@papuSpartan
Copy link
Owner

From what i've been able to tell so far, it's not the certificate itself, but having to do with internal api routes being wholly missing. I'm unsure exactly why but it at least appears that the progress bar route is not added when the api is set up using tls now. I don't know yet if it's because of an update to gradio, or one of the more recent updates to the webui relating to CORS.

@papuSpartan
Copy link
Owner

Looks like this is the issue gradio-app/gradio#563

@bharadwaj509
Copy link

Yeah I am getting a similar error but @Snazzie were you able to compile your code? I see https in your url. Did you add your certificates in the launch method and run it successfully?

@Snazzie
Copy link
Author

Snazzie commented Apr 13, 2023

Yeah I am getting a similar error but @Snazzie were you able to compile your code? I see https in your url. Did you add your certificates in the launch method and run it successfully?

Ive done nothing except installing this extension via A1111 gui. And next time it launched, this issue occurred.

@bharadwaj509
Copy link

Yeah, So I RDP into the machine and worked with the mic. It is working but I dont know what it is reading. It reads "you" for everything I say.

@papuSpartan
Copy link
Owner

If you are both trying to use this extension with the latest version, you need to disable it for now until this issue is resolved. There is no way to get it to function as it was before until there is a fix from gradio upstream. Otherwise, you will need to use an older commit of the webui.

You can disable the extension without booting the ui by setting the disabled_extensions array to the following in your webui's config.json:

"disabled_extensions": [
        "stable-diffusion-webui-auto-tls-https"
    ],

@hkpD
Copy link

hkpD commented Apr 14, 2023

Do you happen to know which version is the latest version that will work with your extension?

@papuSpartan
Copy link
Owner

Do you happen to know which version is the latest version that will work with your extension?

@hkpD It should work with:

That's from what I last noted in https://github.com/camenduru/sd-webui-extension-records though so it is out of date. It should work with versions a bit newer as well.

@hkpD
Copy link

hkpD commented Apr 14, 2023

It did not work, but I'm using the DirectML version by lshqqytiger. I'm not sure if that makes any difference but it most likely does.

@papuSpartan
Copy link
Owner

papuSpartan commented Apr 15, 2023

@hkpD that fork is currently also using gradio 3.23 so it shouldn't work.

@hkpD
Copy link

hkpD commented Apr 15, 2023

Thank you for leading me toward the right answer. I found a version that works with your extension for now.

@garrettsutula
Copy link

garrettsutula commented Apr 16, 2023

As far as I can tell you can work around this issue by exporting and trusting the TLS cert as a "Trusted Certificate Authority" on the host OS of the computer you're using to browse to Automatic1111.

Once I do that, I no longer get a warning in the browser and similarly the secure WebSocket connection (wss) can be established:

image
image

I don't think this is really related to gradio app/gradio#563, although it's true that this env var is important for the automatic1111 server calls to its own endpoints. So, if that doesn't work there is another workaround where for now you can manually edit blocks.py in your venv or whatever.

I have tested this on Windows & MacOS so far.

@hkpD
Copy link

hkpD commented Apr 16, 2023

I was able to do the same thing, but when I went to generate an image, the certificate error came up.
Are you able to generate an output?

This is what I received when I tried your second method for editing the blocks.py file.

Running with TLS
Traceback (most recent call last):
  File "H:\StableDiffusion\stable-diffusion-webui-directml\launch.py", line 353, in <module>
    start()
  File "H:\StableDiffusion\stable-diffusion-webui-directml\launch.py", line 348, in start
    webui.webui()
  File "H:\StableDiffusion\stable-diffusion-webui-directml\webui.py", line 257, in webui
    app, local_url, share_url = shared.demo.launch(
  File "H:\StableDiffusion\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\blocks.py", line 1483, in launch
    requests.get(f"{self.local_url}startup-events", verify=ssl_verify)
NameError: name 'ssl_verify' is not defined
Press any key to continue . . .

@garrettsutula
Copy link

garrettsutula commented Apr 16, 2023

I was able to do the same thing, but when I went to generate an image, the certificate error came up. Are you able to generate an output?

This is what I received when I tried your second method for editing the blocks.py file.

Running with TLS
Traceback (most recent call last):
  File "H:\StableDiffusion\stable-diffusion-webui-directml\launch.py", line 353, in <module>
    start()
  File "H:\StableDiffusion\stable-diffusion-webui-directml\launch.py", line 348, in start
    webui.webui()
  File "H:\StableDiffusion\stable-diffusion-webui-directml\webui.py", line 257, in webui
    app, local_url, share_url = shared.demo.launch(
  File "H:\StableDiffusion\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\blocks.py", line 1483, in launch
    requests.get(f"{self.local_url}startup-events", verify=ssl_verify)
NameError: name 'ssl_verify' is not defined
Press any key to continue . . .

Ah, my bad - you're right. I must have somehow been running an older version of a dependency or SOMETHING but I started having the same problem.

FORTUNATELY it led to finding another workaround: gradio-app/gradio@417004f

This disables cert verification for the http client used to make calls back to itself in the queuing module.

edit: originally linked to a change in utils.py but that was extraneous.

@hkpD
Copy link

hkpD commented Apr 16, 2023

YES! Thank you guys so much! It is all working now and I am able to generate output

@papuSpartan
Copy link
Owner

papuSpartan commented Apr 17, 2023

The Web-socket thing was a problem on my machine. The ssl_verify=False patch should work while being completely safe because it is only ignoring verification on circular requests (made from webui locally back to itself). I'll keep this issue open until the fix is merged into gradio at the least.

@garrettsutula
Copy link

Idk how fast it'll get merged but I opened a PR to update gradio and add --disable-tls-verify arg

AUTOMATIC1111/stable-diffusion-webui#9907

@papuSpartan
Copy link
Owner

@garrettsutula
I saw that, it may never be though. If vlad merges it into his fork, I'll probably just swap to primarily supporting auto-tls for vlad's.

@garrettsutula
Copy link

I'll cherry pick the commits over into that fork & submit a PR ¯_(ツ)_/¯

@papuSpartan
Copy link
Owner

You should be able to fix this issue now by passing --disable-tls-verify in your sdwui launch arguments.

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

5 participants