-
-
Notifications
You must be signed in to change notification settings - Fork 148
Description
Introduction
Will not connect to MSSQL server. I am able to connect to the MSSQL server with other tools such as DBeaver.
To Reproduce
set RUST_LOG=trace && /usr/bin/sqlpage.bin
Actual behavior
After following these steps, what happened ?
Failed to connect to the database: error communicating with database: tls handshake eof. Retrying in 5 seconds.
(I'll paste the full trace log at the end.)
Expected behavior
Connection to the database. It works when using ?encrypt=not_supported, but encryption is necessary for my use case.
Version information
- OS: Ubuntu 22.04
- Database MSSQL (hosted on a different Windows server)
- SQLPage Version 0.34.0
Additional context
I think I've removed all the important security information:
Log Trace:
[2025-04-30T19:10:19.163Z DEBUG sqlpage] No .env file found, using only environment variables and configuration files
[2025-04-30T19:10:19.164Z DEBUG sqlpage::app_config] Loading configuration from environment
[2025-04-30T19:10:19.164Z DEBUG sqlpage::app_config] Loading configuration from "/var/www/sqlpage/sqlpage"
[2025-04-30T19:10:19.164Z DEBUG sqlpage::app_config] Loading configuration from file: "./sqlpage/sqlpage"
[2025-04-30T19:10:19.164Z TRACE sqlpage::app_config] Configuration sources: Value {
origin: None,
kind: Table(
{
"ssh_tty": Value {
origin: Some(
"the environment",
),
kind: String(
"/dev/pts/0",
),
},
"nvm_cd_flags": Value {
origin: Some(
"the environment",
),
kind: String(
"",
),
},
"lessopen": Value {
origin: Some(
"the environment",
),
kind: String(
"| /usr/bin/lesspipe %s",
),
},
"home": Value {
origin: Some(
"the environment",
),
kind: String(
"/home/gwm_admin",
),
},
"shlvl": Value {
origin: Some(
"the environment",
),
kind: I64(
1,
),
},
"xdg_data_dirs": Value {
origin: Some(
"the environment",
),
kind: String(
"/usr/local/share:/usr/share:/var/lib/snapd/desktop",
),
},
"user": Value {
origin: Some(
"the environment",
),
kind: String(
"gwm_admin",
),
},
"nvm_dir": Value {
origin: Some(
"the environment",
),
kind: String(
"/home/gwm_admin/.nvm",
),
},
"logname": Value {
origin: Some(
"the environment",
),
kind: String(
"gwm_admin",
),
},
"ls_colors": Value {
origin: Some(
"the environment",
),
kind: String(
"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.webp=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:.xspf=00;36:",
),
},
"xdg_session_class": Value {
origin: Some(
"the environment",
),
kind: String(
"user",
),
},
"lang": Value {
origin: Some(
"the environment",
),
kind: String(
"en_US.UTF-8",
),
},
"_": Value {
origin: Some(
"the environment",
),
kind: String(
"/usr/bin/sqlpage.bin",
),
},
"xdg_session_id": Value {
origin: Some(
"the environment",
),
kind: I64(
3221,
),
},
"rbenv_shell": Value {
origin: Some(
"the environment",
),
kind: String(
"bash",
),
},
"database_url": Value {
origin: Some(
"sqlpage/sqlpage.json",
),
kind: String(
"mssql://User:Password@mssql.mypathbook.online/schema?encrypt=true",
),
},
"rust_log": Value {
origin: Some(
"the environment",
),
kind: String(
"trace",
),
},
"ssh_client": Value {
origin: Some(
"the environment",
),
kind: String(
"98.213.90.135 47538 ****",
),
},
"path": Value {
origin: Some(
"the environment",
),
kind: String(
"/home/gwm_admin/.local/bin:/home/gwm_admin/.rbenv/shims:/home/gwm_admin/.rbenv/bin:/home/gwm_admin/.rbenv/shims:/home/gwm_admin/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
),
},
"term": Value {
origin: Some(
"the environment",
),
kind: String(
"xterm-256color",
),
},
"lessclose": Value {
origin: Some(
"the environment",
),
kind: String(
"/usr/bin/lesspipe %s %s",
),
},
"oldpwd": Value {
origin: Some(
"the environment",
),
kind: String(
"/var/www/sqlpage/sqlpage",
),
},
"shell": Value {
origin: Some(
"the environment",
),
kind: String(
"/bin/bash",
),
},
"xdg_session_type": Value {
origin: Some(
"the environment",
),
kind: String(
"tty",
),
},
"xdg_runtime_dir": Value {
origin: Some(
"the environment",
),
kind: String(
"/run/user/1000",
),
},
"pwd": Value {
origin: Some(
"the environment",
),
kind: String(
"/var/www/sqlpage",
),
},
"motd_shown": Value {
origin: Some(
"the environment",
),
kind: String(
"pam",
),
},
"dbus_session_bus_address": Value {
origin: Some(
"the environment",
),
kind: String(
"unix:path=/run/user/1000/bus",
),
},
"language": Value {
origin: Some(
"the environment",
),
kind: String(
"en_US:",
),
},
"listen_on": Value {
origin: Some(
"sqlpage/sqlpage.json",
),
kind: String(
"0.0.0.0:3712",
),
},
"ssh_connection": Value {
origin: Some(
"the environment",
),
kind: String(
"98.213.90.135 47538 194.238.27.160 ****",
),
},
},
),
}
[2025-04-30T19:10:19.165Z DEBUG sqlpage::app_config] Loaded configuration: AppConfig {
database_url: "mssql://User:Password@mssql.mypathbook.online/schema?encrypt=true",
database_password: None,
max_database_pool_connections: None,
database_connection_idle_timeout_seconds: None,
database_connection_max_lifetime_seconds: None,
sqlite_extensions: [],
listen_on: Some(
0.0.0.0:3712,
),
port: None,
unix_socket: None,
database_connection_retries: 6,
database_connection_acquire_timeout_seconds: 10.0,
web_root: "/var/www/sqlpage",
configuration_directory: "/var/www/sqlpage/sqlpage",
allow_exec: false,
max_uploaded_file_size: 5242880,
https_domain: None,
https_certificate_email: None,
https_certificate_cache_dir: "/var/www/sqlpage/sqlpage/https",
https_acme_directory_url: "https://acme-v02.api.letsencrypt.org/directory",
environment: Development,
site_prefix: "/",
max_pending_rows: 256,
compress_responses: true,
content_security_policy: None,
system_root_ca_certificates: false,
max_recursion_depth: 10,
markdown_allow_dangerous_html: false,
markdown_allow_dangerous_protocol: false,
}
[2025-04-30T19:10:19.165Z DEBUG sqlpage::webserver::database::connect] Connecting to a Mssql database on mssql://User:Password@mssql.mypathbook.online/schema?encrypt=true
[2025-04-30T19:10:19.165Z DEBUG sqlpage::webserver::database::connect] Connecting to database: mssql://User:Password@mssql.mypathbook.online/schema?encrypt=true
[2025-04-30T19:10:19.165Z DEBUG sqlpage::webserver::database::connect] Not creating a custom SQL connection cleanup handler because "/var/www/sqlpage/sqlpage/on_reset.sql" does not exist
[2025-04-30T19:10:19.165Z DEBUG sqlpage::webserver::database::connect] Not creating a custom SQL database connection handler because "/var/www/sqlpage/sqlpage/on_connect.sql" does not exist
[2025-04-30T19:10:19.169Z TRACE mio::poll] registering event source with poller: token=Token(94435845936640), interests=READABLE | WRITABLE
[2025-04-30T19:10:19.184Z DEBUG sqlx_core_oldapi::mssql::connection::establish] Sending T-SQL PRELOGIN with encryption: PreLogin { version: Version { major: 0, minor: 6, build: 40, sub_build: 0 }, encryption: On, instance: None, thread_id: None, trace_id: None, multiple_active_result_sets: None }
[2025-04-30T19:10:19.200Z DEBUG sqlx_core_oldapi::mssql::connection::establish] Received PRELOGIN response: PreLogin { version: Version { major: 11, minor: 0, build: 7507, sub_build: 0 }, encryption: On, instance: None, thread_id: None, trace_id: None, multiple_active_result_sets: None }
[2025-04-30T19:10:19.200Z TRACE sqlx_core_oldapi::mssql::connection::establish] Mssql login phase and data packets encrypted
[2025-04-30T19:10:19.200Z TRACE sqlx_core_oldapi::mssql::connection::tls_prelogin_stream_wrapper] Handshake starting
[2025-04-30T19:10:19.200Z DEBUG rustls::client::hs] No cached session for DnsName("mssql.mypathbook.online")
[2025-04-30T19:10:19.201Z DEBUG rustls::client::hs] Not resuming any session
[2025-04-30T19:10:19.201Z TRACE rustls::client::hs] Sending ClientHello Message {
version: TLSv1_0,
payload: Handshake {
parsed: HandshakeMessagePayload {
typ: ClientHello,
payload: ClientHello(
ClientHelloPayload {
client_version: TLSv1_2,
random: 52d2a12e89108c2707e352323cfa10f8c5c029e67f256167804bbe1cba6fde39,
session_id: 9f512a6bc5f34228893a664d62379fa5eb69abad16d3d710b854f37f0de0551d,
cipher_suites: [
TLS13_AES_256_GCM_SHA384,
TLS13_AES_128_GCM_SHA256,
TLS13_CHACHA20_POLY1305_SHA256,
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
],
compression_methods: [
Null,
],
extensions: [
SupportedVersions(
[
TLSv1_3,
TLSv1_2,
],
),
EcPointFormats(
[
Uncompressed,
],
),
NamedGroups(
[
X25519,
secp256r1,
secp384r1,
],
),
SignatureAlgorithms(
[
RSA_PKCS1_SHA1,
ECDSA_SHA1_Legacy,
RSA_PKCS1_SHA256,
ECDSA_NISTP256_SHA256,
RSA_PKCS1_SHA384,
ECDSA_NISTP384_SHA384,
RSA_PKCS1_SHA512,
ECDSA_NISTP521_SHA512,
RSA_PSS_SHA256,
RSA_PSS_SHA384,
RSA_PSS_SHA512,
ED25519,
ED448,
],
),
ExtendedMasterSecretRequest,
CertificateStatusRequest(
Ocsp(
OcspCertificateStatusRequest {
responder_ids: [],
extensions: ,
},
),
),
ServerName(
[
ServerName {
typ: HostName,
payload: HostName(
DnsName(
"mssql.mypathbook.online",
),
),
},
],
),
KeyShare(
[
KeyShareEntry {
group: X25519,
payload: c91f0e61ac25300a24da28fbd2ff1f1740fa22ed595a7fbff1ed897b39457251,
},
],
),
PresharedKeyModes(
[
PSK_DHE_KE,
],
),
SessionTicket(
Request,
),
],
},
),
},
encoded: 010000f9030352d2a12e89108c2707e352323cfa10f8c5c029e67f256167804bbe1cba6fde39209f512a6bc5f34228893a664d62379fa5eb69abad16d3d710b854f37f0de0551d0014130213011303c02cc02bcca9c030c02fcca800ff0100009c002b00050403040303000b00020100000a00080006001d00170018000d001c001a0201020304010403050105030601060308040805080608070808001700000005000501000000000000001c001a0000176d7373716c2e6d7970617468626f6f6b2e6f6e6c696e65003300260024001d0020c91f0e61ac25300a24da28fbd2ff1f1740fa22ed595a7fbff1ed897b39457251002d0002010100230000,
},
}
[2025-04-30T19:10:19.201Z TRACE sqlx_core_oldapi::mssql::connection::tls_prelogin_stream_wrapper] Writing 266 bytes of TLS handshake
[2025-04-30T19:10:19.217Z TRACE mio::poll] deregistering event source from poller
[2025-04-30T19:10:19.217Z WARN sqlpage::webserver::database::connect] Failed to connect to the database: error communicating with database: tls handshake eof. Retrying in 5 seconds.