Does Firebird ADO.NET 4.10.0.0 Data provider work with Firebird 3.0?

回眸只為那壹抹淺笑 提交于 2019-12-04 14:52:47

I am answering this on the assumption that you installed Firebird 3 and did not modify any of its configuration. By default the installation of Firebird 3 will have some strict security settings:

  • It will only support the new SRP authentication model
  • It will require wire protocol encryption

This means that drivers (like Firebird .NET provider 4.10) that do not yet support the SRP authentication model and wire protocol encryption will not be able to connect out of the box.

To be able to connect you will need to do the following

  1. Enable the legacy authentication model
  2. Downgrade the wire protocol encryption setting from required to enabled
  3. Create a user in the legacy authentication model

These steps all require edits to firebird.conf. If you installed Firebird into Program Files, you need to make sure your editor is running as administrator to be able to save the changes.

Enable legacy authentication

To enable legacy authentication, you need to edit or add the following line to firebird.conf: (note that lines prefixed with # are comments!)

AuthServer = Srp, Legacy_Auth

Downgrade wire protocol encryption

To downgrade the wire protocol encryption setting, you need to edit or add the following line to firebird.conf:

WireCrypt = Enabled

Create a legacy authentication user

To be able to create a user in the legacy authentication model, you need to enable the legacy usermanager plugin by editing or adding the following line to firebird.conf:

UserManager = Srp, Legacy_UserManager

After above changes, restart Firebird, connect to (any) Firebird 3 database with your favorite database management tool using SYSDBA or another admin account and create a user using the Legacy_UserManager with CREATE USER (replace username and password legacy with suitable values):

CREATE USER legacy PASSWORD 'legacy' USING PLUGIN Legacy_UserManager

Make sure to commit, otherwise the user is not really created.

Now you should be able to connect from C# using the user you just created.

This is also documented in the Firebird 3 Release Notes, Chapter 12 Compatibility Issues, Legacy Authentication.

Using gsec or the services functionality to create users is deprecated. If you still want to use either of these to create users in the legacy authentication model, you need to edit firebird.conf and put Legacy_UserManager first in the list.

Support in Firebird .NET provider version 5.0.0.0 and higher

Note that Firebird .NET provider version 5.0.0.0 added support for SRP (without wire protocol encryption). So from Firebird .NET provider version 5 you can use the new authentication model. Just make sure that you downgrade the wire protocol encryption (setting WireCrypt) from Required (default) to Enabled as described above.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!