Closed cosocc closed 1 year ago
Hi @cosocc. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Hi @cosocc. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
thanks for your reply! https://github.com/cosocc/MauiMsql.git
@jonathanpeppers @steveisok thoughts?
@simonrozsival would likely know more.
@cosocc what TLS certificate does the MySQL server use? I would expect this failure in the case of self-signed certificates. Unfortunately, working with self-signed certificates is a bit cumbersome on Android. You will likely need to install the TLS certificate on the Android device or use network security config to tell Android to trust your certificate.
关于linux服务器配置问题: step 1:
暂时这里是我存放的位置
cd /etc/mysql/mysql.conf.d#
step 2 :
/etc/mysql/mysql.conf.d#
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 step 3:
等待片刻会让你输入认证密码: Enter Pem pass phrase: ****
step4: Country Name (2 letter code) [AU] : CH
step5: State or Province Name (full name) [Some-State] :Zhe Jiang
step6: Locality Name (eg,city) []: Wen Zhou
step7:
Oraganizational Unit Name (eg, section) []:Development Team
step8: common Name (e.g. server FQDN or your name) []:cosocc
step9: Email Address [] :121907007@qq.com
到这里已经生成了 cert.pem key.pem
vim mysqld.cnf
[mysqld] ssl-cert=/etc/mysql/mysql.conf.d/cert.pem ssl-key=/etc/mysql/mysql.conf.d/key.pem
保存退出:
wq
然后在项目中进行相关的配置 D:\MauiMsql\Platforms\Android\AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
< application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true" android:networkSecurityConfig="@xml/network_security_config"></application>
< uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
复制代码
D:\MauiMsql\Platforms\Android\Resources\xml\network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<!--<certificates src="@raw/cert.pem"/>-->
<!-- Replace with your certificate file name -->
</trust-anchors>
</base-config>
</network-security-config>
复制代码
D:\MauiMsql\Platforms\Android\Resources\raw\cert.pem D:\MauiPlayer\MauiMsql\Platforms\Android\Resources\raw\key.pem
@cosocc what TLS certificate does the MySQL server use? I would expect this failure in the case of self-signed certificates. Unfortunately, working with self-signed certificates is a bit cumbersome on Android. You will likely need to install the TLS certificate on the Android device or use network security config to tell Android to trust your certificate. @simonrozsival thank you very so much ! I edited and resolved the issue as mentioned above, although there are still some lingering questions. However, it has helped resolve the debugging problem. I'm grateful for everyone's attention!
Sorry, my English is not good, so some places directly use Chinese!
Description
Debugging works fine on Windows, but when I switch to running it on a mobile device, I encounter numerous errors.
Steps to Reproduce
No response
Link to public reproduction project repository
https://github.com/cosocc/MauiMsql.git
Version with bug
7.0.92
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output