Firebird ADO.NET 4.10.0.0数据提供程序是否可以与Firebird 3.0一起使用? [英] Does Firebird ADO.NET 4.10.0.0 Data provider work with Firebird 3.0?

查看:74
本文介绍了Firebird ADO.NET 4.10.0.0数据提供程序是否可以与Firebird 3.0一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在尝试将我的ASP.net 4.5项目连接到最新发布的Firebird 3.0。



我正在使用Visual Studio 2015社区版Firebird 3(64位),并使用NuGet来获取ADO.NET 4.10.0.0。



但是,当我尝试连接时,出现以下消息异常:


this.connect.ServerVersion抛出了类型为'System.InvalidOperationException'的异常


我收到一些其他消息:


消息:连接已关闭

来源:FirebirdSQL.Data.Fierbird.Client

StackTrace:

在C:\Users中的FirebirdSql.Data.FirebirdClient.FbConnection.get_ServerVersion() Jiri \文档\开发\ NETProvider\工作\ NETProvider\ src\ FirebirdSql.Data.FirebirdClient\ FirebirdClient\ FbConnection.cs:line 217


IBExpert连接没有任何问题。



此环境以前可以在Firebird 2.5和较旧的ADO.Net上使用。



目前最好的猜测是它不受支持,但是我在网上的研究尚无定论(从我的观点可能会发现,有迹象表明它已经使用Firebird 3 RC1进行了测试)。



如果有人可以指出正确的方向来实现这一目标,那就太棒了。 / p>

预先感谢!

解决方案

我在此假设下回答您安装了Firebird 3并且未修改其任何配置。默认情况下,Firebird 3的安装将具有一些严格的安全设置:




  • 它将仅支持新的SRP身份验证模型

  • 它将需要有线协议加密



这意味着驱动程序(如Firebird .NET provider 4.10)不需要但仍支持SRP身份验证模型,并且有线协议加密将无法立即使用。



要进行连接,您需要执行以下操作


  1. 启用传统身份验证模型

  2. 将有线协议加密设置从必需降级为启用

  3. 在旧版身份验证模型中创建用户

这些步骤都需要对进行编辑firebird.conf 。如果将Firebird安装到 Program Files 中,则需要确保编辑器以管理员身份运行才能保存更改。



启用旧式身份验证



要启用旧式身份验证,您需要编辑以下行或将其添加到 firebird.conf :(请注意,以开头的行是注释!)

  AuthServer = Srp,Legacy_Auth 



降级有线协议加密



要降级有线协议加密设置,您需要编辑以下行或将以下行添加到 firebird.conf

  WireCrypt =启用



创建旧版身份验证用户



要能够在旧版身份验证模型中创建用户,您需要通过在<$ c $中编辑或添加以下行来启用旧版usermanager插件c> firebird.conf :

  UserManager = Srp,Legacy_UserManager 

上述更改后,重新启动Firebird,连接到(任意)Firebird 3数据库以及您喜欢的数据库管理工具(使用SYSDBA或其他管理员帐户),并使用Legacy_UserManager和 创建用户 (替换用户名和密码旧版,并带有合适的值):

 创建用户旧版密码' Legacy_UserManager 

请务必提交,否则将不会真正创建用户。



现在,您应该可以使用刚刚创建的用户从C#连接。



这也记录在< href = http://firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-compat-legacyauth.ht ml rel = nofollow> Firebird 3发行说明,第12章兼容性问题,旧版身份验证。



使用 gsec 或创建用户的服务功能已弃用。如果仍要使用这两个方法中的任何一个在旧版身份验证模型中创建用户,则需要编辑 firebird.conf 并放入 Legacy_UserManager 在列表中排第一。



支持Firebird .NET提供程序5.0.0.0及更高版本



请注意,Firebird .NET提供程序版本5.0.0.0添加了对SRP的支持(无有线协议加密)。因此,从Firebird .NET提供程序版本5开始,您可以使用新的身份验证模型。只需确保将有线协议加密(设置 WireCrypt )从 Required (默认)降级为如上所述启用


I'm currently trying to get my ASP.net 4.5 project connecting to the recently release Firebird 3.0.

I'm using Visual Studio 2015 Community edition, Firebird 3 (64 bit), and used NuGet to get the ADO.NET 4.10.0.0.

However, when I try to connect, I get an exception withe the following message:

this.connect.ServerVersion threw an exception of type 'System.InvalidOperationException'

Some other messages that I get:

Message: "The connection is closed"
Source: FirebirdSQL.Data.Fierbird.Client
StackTrace:
at FirebirdSql.Data.FirebirdClient.FbConnection.get_ServerVersion() in C:\Users\Jiri\Documents\devel\NETProvider\working\NETProvider\src\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbConnection.cs:line 217

IBExpert connects without any problems.

This environment previously worked with Firebird 2.5 and an older ADO.Net

Best guess right now is that it's not supported but my research online was inconclusive (from what I could find, there were indications that it was tested with Firebird 3 RC1)

If anyone can point me in the right direction to get this going, it would be awesome.

Thanks in advance!

解决方案

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.

这篇关于Firebird ADO.NET 4.10.0.0数据提供程序是否可以与Firebird 3.0一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆