Reputation: 11
I have a mariadb database on my local network that I want to update when I launch a quick action on an image file in the Finder. I created the quick action using an automator workflow. The workflow has a single shell script step taht launches a .net console application that connects to the database and updates it based on the file data.
It used to work very well on previous MacOS versions but recently (a couple of months ago), it doesn't connect to the database. I suspect a security permissions issue.
I check that the program is working as expected by running it from Terminal app or running the workflow in Automator. There is no issue. It happens only in Quick Action context. To avoid potential issues with libraries, I modified the program to just open a socket connection to the database. The problem is the same and only in Quick Action : "No route to host 192.168.XXX.YYY:3306"
I signed the application using an apple dev certificate (the same I use on XCode to develop Swift Apps) and added the following entitlements (maybe too permisive):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.host</key>
<string>192.168.XXX.YYY</string>
<key>com.apple.security.automation.apple-events</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>
But it still doesn't work.
Code to test the connection :
try
{
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Connect("192.168.XXX.YYY", 3306);
// Log success
}
catch (Exception ex)
{
// Log Error
}
.Net version : 8.0 macOS version : 15.2 (24C101)
Any suggestion?
Upvotes: 0
Views: 28
Reputation: 11
OK, I had to properfly sign the application. Info.plist was not correctly added to the package. Once the package has been propertly formatted and signed, my app was able to connect to remote network. Of course, I had to allow local network access via a dialog box that pops up at first run of the quick action
Upvotes: 0