Repository navigation
Conversation
…ires it, escalate by default. Changes the behaviour of the pre-login to automatically try again if the server requires encryption to be enabled but the user hasn't configured the client in that way. Still allows for the user to explicitly state that they do not ever want to use encryption but specifying the value as false. Partially undoes the work done in ceaa8dc and is a change in the behaviour, but brings this driver more inline with other TDS drivers such as jTDS.
|
That thing where you've not worked on a project for so long you discover you're no longer a maintainer ;) doh! |
|
@ciaranj Did you get to test if retry works? Just noticed that driver sends |
|
Retry does work definitely. However the server does have errors in the event view, I wonder if that's related :) |
|
Most likely they are related :) Can you try sending |
| this.debug.log('connection to ' + this.config.server + ':' + this.config.options.port + ' closed'); | ||
| if (this.state === this.STATE.REROUTING) { | ||
| this.debug.log('Rerouting to ' + this.routingData.server + ':' + this.routingData.port); | ||
| if (typeof this.routingData !== 'undefined') { |
There was a problem hiding this comment.
This change here seems unrelated? 🤔 If it's not related to the other changes, could you revert this?
There was a problem hiding this comment.
Ah, no, I see that you're re-using the re-routing logic here. I'm not sure how I feel about this, but if that's working, why not? 👍
There was a problem hiding this comment.
Yeah I had the same feeling if I'm honest, but I traded that against the scale of change I'd need to do to encapsulate a 'reconnect' state change :/
| enableArithAbort: false, | ||
| enableAnsiNullDefault: true, | ||
| encrypt: false, | ||
| encrypt: undefined, |
There was a problem hiding this comment.
👍 for sane defaults!
| this.debug.log('connection to ' + this.config.server + ':' + this.config.options.port + ' closed'); | ||
| if (this.state === this.STATE.REROUTING) { | ||
| this.debug.log('Rerouting to ' + this.routingData.server + ':' + this.routingData.port); | ||
| if (typeof this.routingData !== 'undefined') { |
There was a problem hiding this comment.
Ah, no, I see that you're re-using the re-routing logic here. I'm not sure how I feel about this, but if that's working, why not? 👍
| if (this.config.options.encrypt === false) { | ||
| this.emit('connect', ConnectionError("Server requires encryption, set 'encrypt' config option to true.", 'EENCRYPT')); | ||
| return this.close(); | ||
| } else if (typeof this.config.options.encrypt === 'undefined') { |
There was a problem hiding this comment.
What do you think about changing the conditions here to be a bit more explicit?
if (this.config.options.encrypt === true) {
...
} else if (this.config.options.encrypt === false) {
...
} else {
...
}There was a problem hiding this comment.
I don't mind tbh. Semantically I guess it would still be the same?
|
Also, as @v-suhame already suggested, can you change the prelogin payload to send |
|
Yeah, it's on my list :/ ( to change the payload) |
|
Do you think just changing the default for the @v-suhame What do you think about this ☝️ proposal? It'd solve the same issue as the code in this pull request, but without adding more code to Tedious. |
|
Sure thing, it was only done this way so as to not negatively impact any existing consumers of the driver (but you’re right we could rely on semver for that) |
|
I was on same page as @ciaranj regarding backward compatibility. After some reading, figured its version older than SQL Server 2000 that doesn't support SSL, that hopefully has a very small customer base(or none at all). |
Changes the behaviour of the pre-login to automatically try again if the server requires
encryption to be enabled but the user hasn't configured the client in that way.
Still allows for the user to explicitly state that they do not ever want to use
encryption by specifying the value as false. Or to always use and require encryption by setting the value as true.
This commit partially undoes the work done in ceaa8dc and is a change in the behaviour, but brings this driver more inline with other TDS drivers such as jTDS.