Skip to content

API service masks SSL certificate errors with the misleading "Cannot specify targets" message #1354

@jess-tech-lab

Description

@jess-tech-lab

Summary

Testing the API service with invalid certificate paths (e.g., /etc/hosts) caused the SSL handshake to fail (e.g., PEM lib error). The child process dies, and the parent process "falls through" to the CLI target validation, resulting in a misleading Cannot specify the target(s) error instead of the actual SSL failure.

Steps to Reproduce

Start the API service with the command:

poetry run nettacker --start-api --api-host 127.0.0.1 --api-port 8080 --api-debug-mode --api-cert /etc/hosts --api-cert-key /etc/hosts

The error message of Cannot specify the target(s) was returned:

Image

Expected Behavior

The API service should terminate immediately with a clear message such as Failed to load SSL configuration. Please check your --api-cert and --api-cert-key files..

Environment

  • macOS (Apple Silicon, Homebrew Python)
  • Python 3.12
  • Nettacker 0.4.0
  • Installed and executed via Poetry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions