File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import {
2121import * as tls from 'tls'
2222
2323/**
24- * Implementation of SQLiteCloudConnection that connects to the database using specific Bun APIs
24+ * Implementation of SQLiteCloudConnection that connects to the database using specific tls APIs
2525 * that connect to native sockets or tls sockets and communicates via raw, binary protocol.
2626 */
2727export class SQLiteCloudTlsConnection extends SQLiteCloudConnection {
@@ -50,7 +50,7 @@ export class SQLiteCloudTlsConnection extends SQLiteCloudConnection {
5050 const connectionOptions = {
5151 host : config . host ,
5252 port : config . port as number ,
53- rejectUnauthorized : false ,
53+ rejectUnauthorized : true ,
5454 // Server name for the SNI (Server Name Indication) TLS extension.
5555 // https://r2.nodejs.org/docs/v6.11.4/api/tls.html#tls_class_tls_tlssocket
5656 servername : config . host
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ export function getInitializationCommands(config: SQLiteCloudConfig): string {
3939 // first user authentication, then all other commands
4040 let commands = ''
4141
42+ if ( config . non_linearizable ) {
43+ commands += 'SET CLIENT KEY NONLINEARIZABLE TO 1; '
44+ }
45+
4246 if ( config . apikey ) {
4347 commands = `AUTH APIKEY ${ config . apikey } ; `
4448 } else {
@@ -57,9 +61,6 @@ export function getInitializationCommands(config: SQLiteCloudConfig): string {
5761 if ( config . zerotext ) {
5862 commands += 'SET CLIENT KEY ZEROTEXT TO 1; '
5963 }
60- if ( config . non_linearizable ) {
61- commands += 'SET CLIENT KEY NONLINEARIZABLE TO 1; '
62- }
6364 if ( config . noblob ) {
6465 commands += 'SET CLIENT KEY NOBLOB TO 1; '
6566 }
You can’t perform that action at this time.
0 commit comments