Skip to content

openssl vs. gnutls #588

@bf4

Description

@bf4

I'm on the Heroku-22 stack and had been using the buildpack https://github.com/rails-sqlserver/heroku-buildpack-freetds.git#v1.1.5

After removing the buildpack to rely on the vendored freetds present in tiny_tds 3.2.0, some, but not all, of our database connections began to fail at login.

After comparing the outputs of tsql -C prior to removing the buildpack and bundle exec tsql-ttds -C afterwards, I noticed

- OpenSSL: yes
- GnuTLS: no
+ OpenSSL: no
+ GnuTLS: yes
+ MARS: yes

which led me to believe that, at least on Heroku-22, for some connections, GnuTLS works and OpenSSL doesn't.

I'm not sure why the tradeoff is for changing the build args so for now I'm just reporting this for discussion.

This is against tiny_tds v3.2.0 on Ruby 3.3.4

Related rails-sqlserver/heroku-buildpack-freetds#20
On topic #521 (comment)

#### Buildpack
# FREETDS_VERSION=1.4.26
# https://github.com/rails-sqlserver/heroku-buildpack-freetds.git#v1.1.5
tsql -C
Compile-time settings (established with the "configure" script)
                            Version: freetds v1.4.26
             freetds.conf directory: /tmp/build_home/freetds/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: no
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 7.3
                              iODBC: no
                           unixodbc: no
              SSPI "trusted" logins: no
                           Kerberos: no
                            OpenSSL: no
                             GnuTLS: yes
                               MARS: yes
#### Vendored
# FREETDS_VERSION=1.4.26
bundle exec tsql-ttds -C
[TinyTds][v3.2.0][tsql]: /app/vendor/bundle/ruby/3.3.0/gems/tiny_tds-3.2.0-x86_64-linux-gnu/ports/x86_64-linux-gnu/bin/tsql
Compile-time settings (established with the "configure" script)
                            Version: freetds v1.4.26
             freetds.conf directory: /home/runner/work/tiny_tds/tiny_tds/ports/x86_64-linux-gnu/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: no
                      Thread safety: yes
                      iconv library: yes
                        TDS version: auto
                              iODBC: no
                           unixodbc: no
              SSPI "trusted" logins: no
                           Kerberos: no
                            OpenSSL: yes
                             GnuTLS: no
Example of connection failing at password auth
TDSVER="${TSQL_TDSVER}" bundle exec tsql-ttds -H "${test_ip}" -p "${test_port}" -U "$TSQL_USERNAME"

[TinyTds][v3.2.0][tsql]: /app/vendor/bundle/ruby/3.3.0/gems/tiny_tds-3.2.0-x86_64-linux-gnu/ports/x86_64-linux-gnu/bin/tsql
Password:

locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Error 20017 (severity 9):
	Unexpected EOF from the server
Error 20002 (severity 9):
	Adaptive Server connection failed
Error 20002 (severity 9):
	Adaptive Server connection failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions