Skip to content

Deleting a host leaves behind orphaned certificates #35

Description

@riversdev0

Describe the bug
When deleting a host, the certificate assigned to that host is left behind in the database.

Your Environment (please supply the following information):
n/a

Steps To Reproduce

  1. On the MySQL database, run select c.id,serial,h.id,hostname from certificates as c left join hosts as h on c.id=h.c_id;
  2. Go to a zone
  3. Pick a host and find its serial number in the database output
  4. Delete that host from that zone
  5. Re-run the MySQL query in step 1, and see that the serial is still in the table, and the hostname is gone.

Caution: a certificate should not be deleted unless it has no hosts that reference it. (A certificate is able to have more than 1 host referencing it.)

Additional Info
Before:

| 306 | 12347781757552318374407394452727290987     | 27   | myserver.example.com        |

After:

| 306 | 12347781757552318374407394452727290987     | NULL | NULL                        |

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions