Repository navigation
Support disablement of SSL validation for development purposes #214
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
Merged
Phil Nachreiner (philnach)
merged 37 commits into
AzureCosmosDB:main
from
philnach:vnextemulator
Jan 7, 2026
Merged
Changes from 13 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
af27c17
Disabling SSL option for development purposes to work with vnext emul…
philnach 24546e5
Add ability to provide password with PFX
philnach bbd7a88
Merge branch 'main' into vnextemulator
philnach d3e5996
Update Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/CosmosEx…
philnach cbd828a
Update Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/CosmosEx…
philnach 1752de4
Dispose properly of the X509Chain
philnach 74671a2
Updates to log on failure
philnach d7a2c0c
Add logger to certificates as supposed to writeline
philnach 51c5ac2
remove duplicate cert check
philnach c4c6a20
PR feedback
philnach c2b8dc8
Update Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/CosmosEx…
philnach 24205f3
add null check
philnach fbae2e8
add date check to cert
philnach d11b2e3
Update Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/CosmosEx…
philnach 1c98b72
Update Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/CosmosEx…
philnach 424c5f6
fix build issues
philnach 55a108f
Merge branch 'vnextemulator' of https://github.com/philnach/data-migr…
philnach 3c2af00
Update Extensions/Cosmos/CERTIFICATE_EXAMPLES.md
philnach e5965c3
Update Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/CosmosSe…
philnach d4edcfd
Merge branch 'main' into vnextemulator
markjbrown c8170df
Update Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/CosmosEx…
philnach a95d075
Update Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/CosmosSe…
philnach d2cfecc
Remove all the complexity and simplify to just the disabledsetting
philnach 52a5977
Merge branch 'vnextemulator' of https://github.com/philnach/data-migr…
philnach 7387b3a
missed merge
philnach 8469486
remove examples since we don't support any of them
philnach a1cc6d4
remove vnext mention
philnach f0a53e7
simplify
philnach ccc479f
slight fix on readme
philnach e9b085a
fix last thing copilot was complaining about
philnach 8709b82
Update Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/CosmosEx…
philnach 47a50c9
Add AllowBulkExecution
philnach ca8f2f0
Minor wording tweaks
philnach 5169381
Add a test for the SSL disable
philnach a654f9d
Fix broken tests
philnach 9dd7437
Merge branch 'main' into vnextemulator
philnach 5fddf94
Merge branch 'main' into vnextemulator
philnach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,210 @@ | ||
| # Custom Certificate Configuration Examples | ||
|
|
||
| This file demonstrates how to use the new custom certificate configuration options in the Cosmos DB data migration tool. | ||
|
|
||
| ## Example 1: Disable SSL Validation (Development/Emulator Only) | ||
|
|
||
| For development with the Cosmos DB emulator when certificates are problematic: | ||
|
|
||
| ```json | ||
| { | ||
| "Source": "json", | ||
| "Sink": "cosmos-nosql", | ||
| "SourceSettings": { | ||
| "FilePath": "C:\\data\\sample-data.json" | ||
| }, | ||
| "SinkSettings": { | ||
| "ConnectionString": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", | ||
| "Database": "SampleDB", | ||
| "Container": "SampleContainer", | ||
| "DisableSslValidation": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Example 2: Custom Certificate Path | ||
|
|
||
| For custom Cosmos DB instances with self-signed or corporate certificates: | ||
|
|
||
| ```json | ||
| { | ||
| "Source": "json", | ||
| "Sink": "cosmos-nosql", | ||
| "SourceSettings": { | ||
| "FilePath": "C:\\data\\sample-data.json" | ||
| }, | ||
| "SinkSettings": { | ||
| "ConnectionString": "AccountEndpoint=https://my-custom-cosmos.company.com:8081/;AccountKey=...", | ||
| "Database": "ProductionDB", | ||
| "Container": "DataContainer", | ||
| "CertificatePath": "C:\\certificates\\cosmos-custom.cer", | ||
| "PartitionKeyPath": "/id" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Example 3: RBAC with Custom Certificate | ||
|
|
||
| Using RBAC authentication with a custom certificate: | ||
|
|
||
| ```json | ||
| { | ||
| "Source": "json", | ||
| "Sink": "cosmos-nosql", | ||
| "SourceSettings": { | ||
| "FilePath": "C:\\data\\sample-data.json" | ||
| }, | ||
| "SinkSettings": { | ||
| "UseRbacAuth": true, | ||
| "AccountEndpoint": "https://my-cosmos-account.documents.azure.com:443/", | ||
| "EnableInteractiveCredentials": true, | ||
| "Database": "MyDatabase", | ||
| "Container": "MyContainer", | ||
| "CertificatePath": "C:\\certificates\\my-cosmos-cert.pem", | ||
| "PartitionKeyPath": "/partitionKey" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Example 4: Cosmos-to-Cosmos Migration with Custom Certificate | ||
|
|
||
| Migrating from one Cosmos DB instance to another with custom certificate validation: | ||
|
|
||
| ```json | ||
| { | ||
| "Source": "cosmos-nosql", | ||
| "Sink": "cosmos-nosql", | ||
| "SourceSettings": { | ||
| "ConnectionString": "AccountEndpoint=https://source-cosmos.domain.com:8081/;AccountKey=...", | ||
| "Database": "SourceDB", | ||
| "Container": "SourceContainer", | ||
| "CertificatePath": "C:\\certificates\\source-cosmos.cer" | ||
| }, | ||
| "SinkSettings": { | ||
| "ConnectionString": "AccountEndpoint=https://dest-cosmos.domain.com:8081/;AccountKey=...", | ||
| "Database": "DestDB", | ||
| "Container": "DestContainer", | ||
| "CertificatePath": "C:\\certificates\\dest-cosmos.cer", | ||
| "PartitionKeyPath": "/id", | ||
| "WriteMode": "Upsert" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Example 5: Enterprise PFX Certificate with Password | ||
|
|
||
| For enterprise environments using PFX/P12 certificates with mutual TLS authentication: | ||
|
|
||
| ```json | ||
| { | ||
| "Source": "json", | ||
| "Sink": "cosmos-nosql", | ||
| "SourceSettings": { | ||
| "FilePath": "C:\\data\\enterprise-data.json" | ||
| }, | ||
| "SinkSettings": { | ||
| "UseRbacAuth": true, | ||
| "AccountEndpoint": "https://enterprise-cosmos.company.com:443/", | ||
| "Database": "EnterpriseDB", | ||
| "Container": "SecureContainer", | ||
| "CertificatePath": "C:\\enterprise-certs\\cosmos-client.pfx", | ||
| "CertificatePassword": "SecureP@ssw0rd!", | ||
| "PartitionKeyPath": "/tenantId" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Example 6: Enterprise PFX Certificate without Password | ||
|
|
||
| For enterprise environments with unprotected PFX certificates: | ||
|
|
||
| ```json | ||
| { | ||
| "Source": "cosmos-nosql", | ||
| "Sink": "json", | ||
| "SourceSettings": { | ||
| "ConnectionString": "AccountEndpoint=https://enterprise-cosmos.company.com:8081/;AccountKey=...", | ||
| "Database": "EnterpriseDB", | ||
| "Container": "AuditLogs", | ||
| "CertificatePath": "C:\\enterprise-certs\\cosmos-client.p12" | ||
| }, | ||
| "SinkSettings": { | ||
| "FilePath": "C:\\exports\\audit-logs.json" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Example 7: Enterprise Multi-Environment Migration | ||
|
|
||
| Migrating from staging to production with different PFX certificates: | ||
|
|
||
| ```json | ||
| { | ||
| "Source": "cosmos-nosql", | ||
| "Sink": "cosmos-nosql", | ||
| "SourceSettings": { | ||
| "UseRbacAuth": true, | ||
| "AccountEndpoint": "https://staging-cosmos.company.com:443/", | ||
| "Database": "StagingDB", | ||
| "Container": "DataContainer", | ||
| "CertificatePath": "C:\\certs\\staging-client.pfx", | ||
| "CertificatePassword": "StagingPass123!" | ||
| }, | ||
| "SinkSettings": { | ||
| "UseRbacAuth": true, | ||
| "AccountEndpoint": "https://prod-cosmos.company.com:443/", | ||
| "Database": "ProductionDB", | ||
| "Container": "DataContainer", | ||
| "CertificatePath": "C:\\certs\\prod-client.pfx", | ||
| "CertificatePassword": "ProductionSecurePass456!", | ||
| "PartitionKeyPath": "/id", | ||
| "WriteMode": "Upsert" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Security Notes | ||
|
|
||
| ⚠️ **Important Security Considerations:** | ||
|
|
||
| 1. **Never use `DisableSslValidation: true` in production environments** | ||
| - This disables all SSL certificate validation | ||
| - Only use for development with local emulators | ||
|
|
||
| 2. **Store certificate files securely** | ||
| - Use proper file permissions | ||
| - Store in protected directories | ||
| - Consider using Azure Key Vault for production scenarios | ||
|
|
||
| 3. **Certificate file formats supported** | ||
| - `.cer` (binary or base64 encoded) | ||
| - `.crt` (binary or base64 encoded) | ||
|
philnach marked this conversation as resolved.
Resolved
|
||
| - `.pem` (base64 encoded) | ||
| - `.pfx` (PKCS#12, with or without password) | ||
| - `.p12` (PKCS#12, with or without password) | ||
|
|
||
| 4. **PFX/P12 Certificate Security** | ||
| - Never hardcode `CertificatePassword` in configuration files | ||
| - Use environment variables or secure configuration providers for passwords | ||
| - Store PFX files with restricted access permissions (600 on Unix, appropriate ACLs on Windows) | ||
| - Consider using Azure Key Vault or other secure key management systems | ||
| - Ensure PFX files contain both certificate and private key | ||
|
|
||
| 5. **Validate certificate authenticity** | ||
| - Ensure certificate files come from trusted sources | ||
| - Verify certificate thumbprints when possible | ||
| - Use proper certificate authorities for production | ||
| - For PFX certificates, verify the certificate chain and expiration dates | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| If you encounter certificate validation issues: | ||
|
|
||
| 1. **Verify certificate file exists and is readable** | ||
| 2. **Check certificate format and encoding** | ||
| 3. **Ensure certificate matches the server's certificate** | ||
| 4. **For PFX certificates, verify the password is correct** | ||
| 5. **For emulator issues, try `DisableSslValidation: true` (development only)** | ||
| 6. **For production, contact your network administrator for proper certificates** | ||
| 7. **Check that PFX files contain both certificate and private key** | ||
| 8. **Verify certificate expiration dates and certificate chain validity** | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.