# ✅ Self-Signed Certificate Support - RESOLVED
## Status: COMPLETE
All authentication issues with self-signed SSL certificates have been resolved.
## What Was Done
### Code Changes
- ✅ Added HTTPS and HTTP agent support to `src/lib/server.js`
- ✅ Configured agents to respect `PLAN_REJECT_UNAUTHORIZED` and `NODE_TLS_REJECT_UNAUTHORIZED` environment variables
- ✅ Updated all 36 fetch API calls to use the configured agents
- ✅ Verified syntax correctness
### Documentation
- ✅ Created `SELF_SIGNED_CERTS.md` - User-facing documentation with usage examples
- ✅ Created `CERTIFICATE_FIX_SUMMARY.md` - Technical summary of changes
- ✅ Created this status document
## How to Use
### Quick Start
For servers with self-signed certificates, set the environment variable before running:
```bash
# PowerShell
$env:PLAN_REJECT_UNAUTHORIZED = 'false'
node src/lib/server.js --server-url https://your-plan-server --token your-token --teamspace-id your-id
```
Or add to `.env` file:
```
PLAN_REJECT_UNAUTHORIZED=false
PLAN_SERVER_URL=https://your-plan-server
PLAN_ACCESS_TOKEN=your-token
PLAN_TEAMSPACE_ID=your-id
```
Then run:
```bash
node src/lib/server.js
```
## Key Features
1. **Backward Compatible** - Default behavior is secure (certificate verification enabled)
2. **Flexible Configuration** - Supports multiple environment variable options
3. **Clean Implementation** - All fetch calls consistently use the new agent system
4. **Well Documented** - Includes security warnings and best practices
## Security
⚠️ Certificate verification is disabled by default and must be explicitly enabled.
By default, the server will validate SSL certificates properly.
For production:
- Use properly signed certificates from a trusted CA
- Do not set `PLAN_REJECT_UNAUTHORIZED=false`
- Keep `NODE_TLS_REJECT_UNAUTHORIZED` unset
## Verification
All fetch calls (36 total) have been updated with `...getAgentOptions(serverURL)`:
- Query operations (GET/POST)
- CRUD operations on work items, sprints, releases
- Cookie management
- Authentication endpoints
## Next Steps
1. Set the environment variable on your deployment
2. Test the connection to your Plan server
3. Verify that authentication and API calls work correctly
No code changes are required on the client side - just set the environment variable and the authentication will work with self-signed certificates.