Add-In Error: Content is blocked because it isn't signed by a valid security certificate

Add-In Error: Content is blocked because it isn't signed by a valid security certificate

我正在处理 Outlook 加载项应用程序,发现自己无法在本地 运行 它,在“Office 桌面客户端”中尝试 运行 它时出现以下消息:

“加载项错误内容被阻止,因为它没有由有效的安全证书签名”

当我尝试使用 Chrome 或 Edge 运行 加载项时,我反而在加载项中收到以下消息:

“加载项错误:出了点问题,我们无法启动此加载项。请稍后重试或联系您的系统管理员。”

如果我尝试在 Chrome 或 Edge 上点击“重试”,我会收到以下加载项错误:

“此加载项可能无法正确加载,但您仍然可以尝试启动它。”

当我点击开始时,我得到以下信息:

“位于 https://localhost:44364/AddinClient?et=#/read 的网页可能暂时关闭,或者它可能已永久移动到新网址。”

当尝试通过 chrome 在新选项卡中手动转到此地址时,它设法加载到“此站点注意安全”警告之后的选项卡中

我注意到这个问题的一些常见修复方法,例如在 Internet 选项中将本地主机添加到受信任的站点和安装 office-addin-dev-certs,但是这些选项都没有解决问题(我也尝试删除并重新安装我多次看到的证书)。

还有什么我可以尝试的吗?

有关我的设置的一些技术细节,我使用的是 Microsoft® Outlook® for Microsoft 365 MSO(版本 2110 内部版本 16.0.14527.20270)64 位。我正在使用 Windows 10 Pro,加载项的清单文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<!--Created:b1287d2e-c737-4a6d-84ad-8c25896b50dc-->
<OfficeApp
          xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
          xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0"
          xsi:type="MailApp">

  <!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->

  <!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
  <Id>01fa9df4-6148-4299-b9f6-92898abce052</Id>

  <!--Version. Updates from the store only get triggered if there is a version change. -->
  <Version>1.0.0.0</Version>
  <ProviderName>Test</ProviderName>
  <DefaultLocale>en-GB</DefaultLocale>
  <!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
  <DisplayName DefaultValue="Outlook Addin Dev" />
  <Description DefaultValue="Outlook Addin Dev"/>
  <IconUrl DefaultValue="~remoteAppUrl/AddinClient/assets/images/icon64.png"/>

  <SupportUrl DefaultValue="http://www.MyTestSite.com" />
  <!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
  <AppDomains>
    <AppDomain>https://localhost:44364</AppDomain>
  </AppDomains>
  <!--End Basic Settings. -->

  <Hosts>
    <Host Name="Mailbox" />
  </Hosts>
  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.5" />
    </Sets>
  </Requirements>
  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="~remoteAppUrl/AddinClient"/>
        <RequestedHeight>250</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteItem</Permissions>
  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read" />
  </Rule>
  <DisableEntityHighlighting>false</DisableEntityHighlighting>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
      <Requirements>
        <bt:Sets DefaultMinVersion="1.5">
          <bt:Set Name="Mailbox" />
        </bt:Sets>
      </Requirements>
      <Hosts>
        <Host xsi:type="MailHost">

          <DesktopFormFactor>
            <!-- Location of the Functions that UI-less buttons can trigger (ExecuteFunction Actions). -->
            <FunctionFile resid="functionFile" />

            <!-- Message Read -->
            <ExtensionPoint xsi:type="MessageReadCommandSurface">
              <!-- Use the default tab of the ExtensionPoint or create your own with <CustomTab id="myTab"> -->
              <OfficeTab id="TabDefault">
                <!-- Up to 6 Groups added per Tab -->
                <Group id="loadAddinGroup">
                  <Label resid="groupLabel" />
                  <!-- Launch the add-in : task pane button -->
                  <Control xsi:type="Menu" id="loadAddinOpenPaneButton">
                    <Label resid="paneButtonLabel" />
                    <Supertip>
                      <Title resid="paneSuperTipTitle" />
                      <Description resid="paneSuperTipDescription" />
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="icon16" />
                      <bt:Image size="32" resid="icon32" />
                      <bt:Image size="64" resid="icon64" />
                      <bt:Image size="80" resid="icon80" />
                    </Icon>
                    <Items>
                      <Item id="mainCmd">
                        <Label resid="paneButtonLabel"/>
                        <Supertip>
                          <Title resid="paneButtonLabel"/>
                          <Description resid="paneSuperTipDescription"/>
                        </Supertip>
                        <Icon>
                          <bt:Image size="16" resid="icon16" />
                          <bt:Image size="32" resid="icon32" />
                          <bt:Image size="64" resid="icon64" />
                          <bt:Image size="80" resid="icon80" />
                        </Icon>
                        <Action xsi:type="ShowTaskpane">
                          <SourceLocation resid="loadAddinTaskPaneUrl" />
                          <SupportsPinning>true</SupportsPinning>
                        </Action>
                      </Item>
                      <Item id="signOutCmd">
                        <Label resid="paneSignOutLabel"/>
                        <Supertip>
                          <Title resid="paneSignOutLabel"/>
                          <Description resid="paneSignOutSuperTipDescription"/>
                        </Supertip>
                        <Icon>
                          <bt:Image size="16" resid="cog16" />
                          <bt:Image size="32" resid="cog32" />
                          <bt:Image size="64" resid="cog64" />
                          <bt:Image size="80" resid="cog80" />
                        </Icon>
                        <Action xsi:type="ExecuteFunction">
                          <FunctionName>signOut</FunctionName>
                        </Action>
                      </Item>
                    </Items>
                  </Control>
                  <!-- Go to http://aka.ms/ButtonCommands to learn how to add more Controls: ExecuteFunction and Menu -->
                </Group>
              </OfficeTab>
            </ExtensionPoint>
            <ExtensionPoint xsi:type="MessageComposeCommandSurface">
              <OfficeTab id="TabDefault">
                <Group id="composeAddInGroup">
                  <Label resid="groupLabel" />
                  <Control xsi:type="Button" id="msgComposeFunctionButton">
                    <Label resid="paneAddCC"/>
                    <Supertip>
                      <Title resid="paneAddCC"/>
                      <Description resid="paneSuperTipDescription"/>
                    </Supertip>
                    <Icon>
                      <bt:Image size="16" resid="icon16" />
                      <bt:Image size="32" resid="icon32" />
                      <bt:Image size="64" resid="icon64" />
                      <bt:Image size="80" resid="icon80" />
                    </Icon>
                    <Action xsi:type="ShowTaskpane">
                      <SourceLocation resid="loadAddInComposePaneUrl" />
                      <SupportsPinning>true</SupportsPinning>
                    </Action>
                  </Control>
                </Group>
              </OfficeTab>
            </ExtensionPoint>
            <!-- Go to http://aka.ms/ExtensionPointsCommands to learn how to add more Extension Points: MessageRead, AppointmentOrganizer, AppointmentAttendee -->
          </DesktopFormFactor>
        </Host>
      </Hosts>

      <Resources>
        <bt:Images>
          <bt:Image id="icon16" DefaultValue="~remoteAppUrl/AddinClient/assets/images/icon16.png"/>
          <bt:Image id="icon32" DefaultValue="~remoteAppUrl/AddinClient/assets/images/icon32.png"/>
          <bt:Image id="icon64" DefaultValue="~remoteAppUrl/AddinClient/assets/images/icon64.png"/>
          <bt:Image id="icon80" DefaultValue="~remoteAppUrl/AddinClient/assets/images/icon80.png"/>
          <bt:Image id="cog16" DefaultValue="~remoteAppUrl/AddinClient/assets/images/cog16.png"/>
          <bt:Image id="cog32" DefaultValue="~remoteAppUrl/AddinClient/assets/images/cog32.png"/>
          <bt:Image id="cog64" DefaultValue="~remoteAppUrl/AddinClient/assets/images/cog64.png"/>
          <bt:Image id="cog80" DefaultValue="~remoteAppUrl/AddinClient/assets/images/cog80.png"/>
        </bt:Images>
        <bt:Urls>
          <bt:Url id="functionFile" DefaultValue="~remoteAppUrl/Functions/FunctionFile.html"/>
          <bt:Url id="loadAddinTaskPaneUrl" DefaultValue="~remoteAppUrl/AddinClient#/read"/>
          <bt:Url id="loadAddInComposePaneUrl" DefaultValue="~remoteAppUrl/AddinClient#/compose"/>
        </bt:Urls>
        <bt:ShortStrings>
          <bt:String id="groupLabel" DefaultValue="Add-In"/>
          <bt:String id="customTabLabel"  DefaultValue="Add-In"/>
          <bt:String id="paneButtonLabel" DefaultValue="Add-In"/>
          <bt:String id="paneSuperTipTitle" DefaultValue="Add-In"/>
          <bt:String id="paneSignOutLabel" DefaultValue="Sign Out"/>
          <bt:String id="paneAddCC" DefaultValue="Add-In"/>
        </bt:ShortStrings>
        <bt:LongStrings>
          <bt:String id="paneSuperTipDescription" DefaultValue="Opens the outlook addin."/>
          <bt:String id="paneSignOutSuperTipDescription" DefaultValue="Sign Out of outlook addin"/>
        </bt:LongStrings>
      </Resources>
    </VersionOverrides>
  </VersionOverrides>
</OfficeApp>

“此站点不安全” 解释说该问题是由证书引起的。要解决此问题,您需要在证书存储区内的本地计算机上安装此证书以接受它作为有效证书。

还有一种方法认为您可以尝试使用 http 并检查它是否适合您。 接受警告并允许网站加载不安全的网站,加载后您可以查看证书并存储在您机器的证书存储中。

我不确定加载项的工作原理,但如果您需要,我会尝试并更新您。