{"action":"closed","issue":{"url":"https://api.github.com/repos/wolfSSL/wolfssl/issues/204","labels_url":"https://api.github.com/repos/wolfSSL/wolfssl/issues/204/labels{/name}","comments_url":"https://api.github.com/repos/wolfSSL/wolfssl/issues/204/comments","events_url":"https://api.github.com/repos/wolfSSL/wolfssl/issues/204/events","html_url":"https://github.com/wolfSSL/wolfssl/issues/204","id":119896900,"number":204,"title":"Can't configure example code to use both PSK and certs.","user":{"login":"przem312","id":4482797,"avatar_url":"https://avatars.githubusercontent.com/u/4482797?v=3","gravatar_id":"","url":"https://api.github.com/users/przem312","html_url":"https://github.com/przem312","followers_url":"https://api.github.com/users/przem312/followers","following_url":"https://api.github.com/users/przem312/following{/other_user}","gists_url":"https://api.github.com/users/przem312/gists{/gist_id}","starred_url":"https://api.github.com/users/przem312/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/przem312/subscriptions","organizations_url":"https://api.github.com/users/przem312/orgs","repos_url":"https://api.github.com/users/przem312/repos","events_url":"https://api.github.com/users/przem312/events{/privacy}","received_events_url":"https://api.github.com/users/przem312/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-02T09:06:03Z","updated_at":"2015-12-22T23:58:09Z","closed_at":"2015-12-22T23:58:09Z","body":"Hello.\r\nIn my use case, I need to configure my server to offer both PSK and certificate-based ECC cipher suites at the same time. Additionally, when client offers a certificate, the exchanged certificates must be verified on both sides (both on client and server). To achieve this, I've set following flags:\r\nwolfSSL_CTX_set_verify( CTX_Client, \r\n                      SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL );\r\n        wolfSSL_CTX_set_verify( CTX_Server,\r\n                      SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL );\r\n\r\nBut when I have such configuration enabled, I cannot connect to server by using PSK ciphersuites, because wolfSSL seems to ignore the fact, that I am using PSK and expects peer to send him a certificate and as it is not sent, fails because of \"SSL_VERIFY_FAIL_IF_NO_PEER_CERT\". \r\n\r\nIs there any way to set this flag only when server selects the certificate based suite, and ignore them when PSK is chosen?\r\n\r\nI've tried to solve the issue this way (internal.c - line 13999):           \r\n               \r\n                if (ssl->options.verifyPeer && ssl->options.failNoCert)\r\n\r\n                               if (!ssl->options.usingPSK_cipher &&!ssl->options.havePeerCert) {\r\n                                   WOLFSSL_MSG(\"client didn't present peer cert\");\r\n                                   return NO_PEER_CERT;\r\n                               }"}}