Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot find publisher when signtool_options is set but doesn't contains any certificate signing options #196

Closed
mullerch opened this issue May 17, 2023 · 8 comments
Labels
bug Something isn't working fixed bug fixed

Comments

@mullerch
Copy link

ℹ️ Info

Version: v3.12.2

Flutter (Channel stable, 3.10.0, on Microsoft Windows [Version 10.0.19045.2965], locale en-CH)

💬 Description

I was building and signing my software fine with msix with version 3.6.3.

I had to upgrade with flutter 3 and cross dependencies. After upgrading, I had an error regarding missing "publisher":

Building package executable... (12.1s)
Built msix:create.
running "flutter build windows"...     72.2s
building msix files...                  
could not find the Publisher value.
you must provide the Publisher value at "msix_config: publisher" in the pubspec.yaml file
the Publisher is the certificate "Subject" in this exact format: "CN=Contoso Software, O=Contoso Corporation, C=US"
see where you can found your certificate Subject:
https://user-images.githubusercontent.com/946652/198945956-ec2ca7f2-36e9-4dfc-959b-48bcd191d82d.png

I didn't see anything related to this in the changelog. Still, after adding the publisher, I get the following error:

Resolving dependencies in ... (1.9s)
Got dependencies in ....
Building package executable... (14.8s)
Built msix:create.
running "flutter build windows"...     156.0s
building msix files...                 75.1s
packing msix files...                   

Unhandled exception:
SignTool Error: No certificates were found that met all the given criteria.

#0      ProcessResultExtensions.exitOnError (package:msix/src/method_extensions.dart:61:7)
#1      SignTool.sign (package:msix/src/sign_tool.dart:248:9)
<asynchronous suspension>
#2      Msix._packMsixFiles (package:msix/msix.dart:137:7)
<asynchronous suspension>
#3      Msix._createMsix (package:msix/msix.dart:99:5)
<asynchronous suspension>
#4      Msix.create (package:msix/msix.dart:57:5)
<asynchronous suspension>
#5      main (file:///.../AppData/Local/Pub/Cache/hosted/pub.dev/msix-3.12.2/bin/create.dart:4:3)
<asynchronous suspension>

I'm using dart run msix:create --certificate-path <path> --certificate-password <password>. My guess here is there is an issue with this option and the certificate is not used. Therefore it was asking for the publisher as it could not get it from the certificate.

Can you confirm the certificate-path option works as expected?

Please note that the "publisher" does not exactly match the certificate subject name as one of the attribute is not accepted (ST).

📜 Pubspec.yaml

msix_config:
  display_name: "Display name"
  identity_name: net.company.name

  publisher: "CN=MyCN, O=MyO, C=MyC"
  publisher_display_name: Company

  install_certificate: false
  signtool_options: "/v"

  architecture: x64
  capabilities: "serialcommunication"
  languages: en-us

  logo_path: "assets/icon.png"

@YehudaKremer
Copy link
Owner

Hello

Use the latest msix version and remove the publisher config field, and try again please

@mullerch
Copy link
Author

If latest version is v3.12.2, that's what I did.

@YehudaKremer
Copy link
Owner

Okay sorry,

Keep using v3.12.2, remove the publisher config field, and try again please

@mullerch
Copy link
Author

After upgrading, I had an error regarding missing "publisher":

I did first try without publisher with v3.12.2.

@YehudaKremer
Copy link
Owner

Its seems that certificate-path option works as expected for me:
image

can you please run without publisher and with the -v flag so we can have more detailed log (make sure not to post here sensitive data)

@mullerch
Copy link
Author

I found the issue. Please add signtool_options: "/v" in your pubspec and you should be able to reproduce.

if (_config.signToolOptions != null) {

@mullerch mullerch changed the title [BUG] Cannot sign anymore with latest versions using certificate-path [BUG] Cannot find publisher when signtool_options is set but doesn't contains any certificate signing options May 17, 2023
@YehudaKremer
Copy link
Owner

I will check it

Thank you for this 👍

@mullerch
Copy link
Author

Thanks for your support

@YehudaKremer YehudaKremer added bug Something isn't working fixed bug fixed labels May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed bug fixed
Projects
None yet
Development

No branches or pull requests

2 participants