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

Deleting a revoked client brings to the 404 page #85

Open
zawyelwin opened this issue Jun 10, 2024 · 4 comments
Open

Deleting a revoked client brings to the 404 page #85

zawyelwin opened this issue Jun 10, 2024 · 4 comments
Assignees

Comments

@zawyelwin
Copy link

When attempting to delete a revoked client, the action redirects to a 404 error page. The deletion process works perfectly if the client is deleted immediately after revocation. However, if the page is refreshed before attempting to delete the client, it results in a 404 error page.

@d3vilh d3vilh self-assigned this Jun 16, 2024
@d3vilh
Copy link
Owner

d3vilh commented Jun 16, 2024

Hi @zawyelwin, thanks for the reporting.

Let me test it, looks like a bug.

EDIT: Did you tried to delete certs created with UI or it were old certificates?

I tried to test it with 0.9.5.4 and 0.5.4 openvpn-server container it seems works fine now, but my test is not completed yet. have few reworked certs which will try to delete tomorrow.

@zawyelwin
Copy link
Author

I tried to delete the certs created from UI. I am also using the same versions as yours. BTW setup using this https://github.com/d3vilh/openvpn-aws.

Thanks for looking into it.

@GoranTopic
Copy link

I am having the same problem and I am not running openvpn-aws. It seems like the UI got stuck thinking that there is a cert to be deleted, when you try to delete it (press the delete button) it redirects you to the 404 page.

@Leeeuijooo
Copy link

Leeeuijooo commented Oct 28, 2024

The issue likely occurred in this section

// @router /certificates/burn/:key/:serial/:tfaname [get]
func (c *CertificatesController) Burn() {
	c.TplName = "certificates.html"
	flash := web.NewFlash()
	CN := c.GetString(":key")
	serial := c.GetString(":serial")
	tfaname := c.GetString(":tfaname")
	logs.Info("Controller: Burning certificate with parameters: CN=%s, serial=%s, tfaname=%s", CN, serial, tfaname)
	if err := lib.BurnCertificate(CN, serial, tfaname); err != nil {
		logs.Error(err)
		//flash.Error(err.Error())
		//flash.Store(&c.Controller)
	} else {
		flash.Success("Success! Certificate for the name \"" + CN + "\" and serial  \"" + serial + "\"  has been removed")
		flash.Store(&c.Controller)
	}
	c.showCerts()
}

The Delete (Burn) function expects three parameters (dynamic variables) from the router annotation:

CN Name (Common Name)
Serial
TFAname (ex : abc@abc.com)

In my case, a 404 page was returned because the TFAname parameter was missing. Therefore, you can remove certificates using the curl command with the appropriate parameters using the following URL structure:

/host/certificates/burn/CNname/Serial/TFAname

For example

# Replace with actual values curl "https://yourdomain.com/certificates/burn/john.doe/ABC123/john@example.com"

Thanks! I hope this helps!

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

4 participants