-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat: add support for selecting SSL key type (ECDSA/RSA) #4218
Open
mnr73
wants to merge
29
commits into
NginxProxyManager:develop
Choose a base branch
from
mnr73:develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
e6ec74c
feat: add support for selecting SSL key type (ECDSA/RSA)
mnr73 8e9e033
fix indent: tab to space
mnr73 891877a
fix ssl key-type certificate
mnr73 2723de2
add ssl_ecdh_curve for more compatibility
mnr73 5e7b69c
add update cipher suites
mnr73 95a94a4
add elliptic-curve
mnr73 111fc28
Revert "add elliptic-curve"
mnr73 04b3608
remove elliptic-curve from certbot command options
mnr73 cb79556
add ssl_key_type in swagger
mnr73 eb5c51a
add support more cipher suites
mnr73 2e45444
change ssl_ciphers for more compatibility
mnr73 5ba7363
fix ssl cipher bug
mnr73 f386f6b
remove elliptic-curve
mnr73 32e0784
support more cipher suites
mnr73 f68c1b7
add Diffie-Hellman Parameters to cipher suites
mnr73 1353937
fix copy address
mnr73 04636b7
add feature: set default server
mnr73 5dc78df
fix messages indent: convert to space
mnr73 c6d884d
fix indent
mnr73 ad36fb5
show select ssl key type just for create new ssl
mnr73 65f971f
add migration names and combine ssl key migrations
mnr73 a121cb1
remove unnecessary whitespace
mnr73 d3a5fac
make ssl_key_type optional
mnr73 2cab405
Merge branch 'fix-bugs' into develop
mnr73 101afa0
remove default_server from certificate object
mnr73 408eab8
remove unesessary default values
mnr73 c135880
Revert "remove default_server from certificate object"
mnr73 f34cb59
Revert "remove unesessary default values"
mnr73 3856b6b
remove default server from certificate object
mnr73 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 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,39 @@ | ||
const migrate_name = 'identifier_for_migrate'; | ||
mnr73 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const logger = require('../logger').migrate; | ||
|
||
/** | ||
* Migrate | ||
* | ||
* @see http://knexjs.org/#Schema | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.up = function (knex) { | ||
|
||
logger.info(`[${migrate_name}] Migrating Up...`); | ||
|
||
return knex.schema.alterTable('proxy_host', (table) => { | ||
table.enum('ssl_key_type', ['ecdsa', 'rsa']).defaultTo('ecdsa').notNullable(); | ||
}).then(() => { | ||
logger.info(`[${migrate_name}] Column 'ssl_key_type' added to table 'proxy_host'`); | ||
}); | ||
}; | ||
|
||
/** | ||
* Undo Migrate | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.down = function (knex) { | ||
logger.info(`[${migrate_name}] Migrating Down...`); | ||
|
||
return knex.schema.alterTable('proxy_host', (table) => { | ||
table.dropColumn('ssl_key_type'); | ||
}).then(() => { | ||
logger.info(`[${migrate_name}] Column 'ssl_key_type' removed from table 'proxy_host'`); | ||
}); | ||
}; |
39 changes: 39 additions & 0 deletions
39
backend/migrations/20241211081223_ssl_key_type_in_proxy.js
This file contains 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,39 @@ | ||
const migrate_name = 'identifier_for_migrate'; | ||
const logger = require('../logger').migrate; | ||
|
||
/** | ||
* Migrate | ||
* | ||
* @see http://knexjs.org/#Schema | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.up = function (knex) { | ||
|
||
logger.info(`[${migrate_name}] Migrating Up...`); | ||
|
||
return knex.schema.alterTable('certificate', (table) => { | ||
table.enum('ssl_key_type', ['ecdsa', 'rsa']).defaultTo('ecdsa').notNullable(); | ||
}).then(() => { | ||
logger.info(`[${migrate_name}] Column 'ssl_key_type' added to table 'proxy_host'`); | ||
}); | ||
}; | ||
|
||
/** | ||
* Undo Migrate | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.down = function (knex) { | ||
logger.info(`[${migrate_name}] Migrating Down...`); | ||
|
||
return knex.schema.alterTable('certificate', (table) => { | ||
table.dropColumn('ssl_key_type'); | ||
}).then(() => { | ||
logger.info(`[${migrate_name}] Column 'ssl_key_type' removed from table 'proxy_host'`); | ||
}); | ||
}; |
This file contains 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,40 @@ | ||
const migrate_name = 'identifier_for_migrate'; | ||
const logger = require('../logger').migrate; | ||
|
||
/** | ||
* Migrate Up | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.up = function (knex) { | ||
logger.info(`[${migrate_name}] Migrating Up...`); | ||
|
||
// Add default_server column to proxy_host table | ||
return knex.schema.table('proxy_host', (table) => { | ||
table.boolean('default_server').notNullable().defaultTo(false); | ||
}) | ||
.then(() => { | ||
logger.info(`[${migrate_name}] Column 'default_server' added to 'proxy_host' table`); | ||
}); | ||
}; | ||
|
||
/** | ||
* Migrate Down | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.down = function (knex) { | ||
logger.info(`[${migrate_name}] Migrating Down...`); | ||
|
||
// Remove default_server column from proxy_host table | ||
return knex.schema.table('proxy_host', (table) => { | ||
table.dropColumn('default_server'); | ||
}) | ||
.then(() => { | ||
logger.info(`[${migrate_name}] Column 'default_server' removed from 'proxy_host' table`); | ||
}); | ||
}; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
text = True | ||
non-interactive = True | ||
webroot-path = /data/letsencrypt-acme-challenge | ||
key-type = ecdsa | ||
elliptic-curve = secp384r1 | ||
preferred-chain = ISRG Root X1 | ||
server = |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default server thing doesn't work. Here's some thoughts:
./backend/templates/default.conf
sets the default site already, so turning it on for any host always causes an error and makes it "Offline" even when passing yourcheckDefaultServerNotExist
test belowThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that when I try to connect to the server with an IoT device, the connection fails. After some research, I found this command:
openssl s_client -connect :443
However, this command returns no response.
When I add a default server to one of the Nginx host configurations, everything works correctly. The above command returns a response, and the IoT device can connect to all the hosts configured in Nginx Proxy Manager.
so i add this feature and its work without any problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Well it was implemented by another contributor a long time ago, that the default HTTPS host returns a bad cipher/ssl cert or something like that. There was a very good reason for that at the time.
The default-site config doesn't apply to HTTPS though, since any certificate assigned to that would always be invalid for a catch-all domain.
Is there no other way you can fetch the ciphers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that the certificate for a default server would always be invalid. However, I haven't found any other solution. Even when I manually configured Nginx (before switching to Nginx Proxy Manager), I spent a week troubleshooting this issue. Without setting a default server in one of the configurations, IoT devices simply cannot connect.
I believe this issue might be related to how SNI is handled.