小编pjo*_*son的帖子

让Chrome接受自签名的localhost证书

我为localhost CN创建了一个自签名SSL证书.Firefox正如预期的那样在最初抱怨之后接受此证书.然而,Chrome和IE拒绝接受它,即使在将证书添加到Trusted Roots下的系统证书存储区之后也是如此.即使我在Chrome的HTTPS弹出窗口中单击"查看证书信息"时列出的证书已正确安装,但仍然坚持认证证书不可信.

我该怎么办才能让Chrome接受证书并停止抱怨?

ssl google-chrome certificate self-signed

1080
推荐指数
39
解决办法
107万
查看次数

原始 static_vector 实现中可能未定义的行为

tl; dr:我认为我的 static_vector 有未定义的行为,但我找不到它。

这个问题是在 Microsoft Visual C++ 17 上。我有这个简单且未完成的 static_vector 实现,即一个可以堆栈分配的固定容量的向量。这是一个 C++17 程序,使用 std::aligned_storage 和 std::launder。我试图将其归结为我认为与该问题相关的部分:

template <typename T, size_t NCapacity>
class static_vector
{
public:
    typedef typename std::remove_cv<T>::type value_type;
    typedef size_t size_type;
    typedef T* pointer;
    typedef const T* const_pointer;
    typedef T& reference;
    typedef const T& const_reference;

    static_vector() noexcept
        : count()
    {
    }

    ~static_vector()
    {
        clear();
    }

    template <typename TIterator, typename = std::enable_if_t<
        is_iterator<TIterator>::value
    >>
    static_vector(TIterator in_begin, const TIterator in_end)
        : count()
    {
        for (; in_begin != in_end; ++in_begin)
        { …
Run Code Online (Sandbox Code Playgroud)

c++ segmentation-fault undefined-behavior c++17

12
推荐指数
1
解决办法
189
查看次数

GCC相当于PDB

我有一个程序,我打算分发给最终用户,并希望收到他们的崩溃报告.如果我使用MSVC,我会生成minidump并将那些发送给我,然后用相应的PDB检查它们以获得有用的堆栈跟踪,至少.

与GCC相同的是什么?我可以生成堆栈跟踪,但如果我希望它有用,则需要将调试符号编译到可执行文件中(使用-g).显然,这对于发布分发来说是不可接受的,因为可执行文件的大小可能相当大.

我google了一下,发现objcopy的引用能够将调试符号分离到一个单独的文件,但该页暗示我仍然需要在发布可执行文件旁边提供调试符号,这显然是不可接受的.

debugging gcc visual-c++

10
推荐指数
2
解决办法
4512
查看次数

设置私有APT存储库时的索引警告

我正在建立一个私有APT存储库,用于将应用程序部署到服务器集群.我已经使用reprepro设置了存储库,基本上遵循了这里的说明,但是使用了预先生成的GPG密钥.

但是,在目标服务器上运行apt-get update时,我不断收到此错误:

W: Failed to fetch http://domU-xx-xx-xx-xx-xx-xx.compute-1.internal/aptrepo/dists/oneiric/non-free/i18n/Index
No Hash entry in Release file /var/lib/apt/lists/partial/domU-xx-xx-xx-xx-xx-xx.compute-1.internal_aptrepo_dists_oneiric_non-free_i18n_Index
Run Code Online (Sandbox Code Playgroud)

我需要担心吗?如果我这样做,我该如何解决?

ubuntu apt

2
推荐指数
1
解决办法
729
查看次数