Thank you :) It works. I didn't know SecPolicyCreateBasicX509 is like "just check the minimum"
It is coming from IoT device
wrong hostname because we are connecting via IP address, this is not really a problem because we have SAN name
long expiration date is our real problem here, we do not want to generate new certificates every 825 days
"ith a serial queue, it will never execute a second task while there's already one executing. That's the definition of "serial". The threads don't matter."Yes, I was wondering about that and just figured it out and wanted to write it here, but again, you were faster!Thank you very much for all informations! It really helped me to understand the differences! ๐Best regards!
"The task will never run on the current thread if you use an async method. That's the whole point of async dispatch: it allows the calling thread to go on to other work while the task executes." Of course! ๐ my bad!Mean while I edited my question but I will put changes here:1. Why the is a dead lock?let queue = DispatchQueue(label: "queue_label")
queue.sync {
queue.sync {
// Dead lock
}
}I read that when there is a serial queue and two nested sync exceutes like in example above, first sync() will execute normally, byt second sync() will stop current thread (because it needs to wait for completion) which is the same as thread of a second sync(), so second sync() can never complete - dead lockBut now this has no sense for me, because serial queue can execute second sync() on other thread, right?
Thanks Ken, I think you opened my eyes ๐In documentation to dispatch_sync there is this sentecne:"As an optimization, this function invokes the block on the current thread when possible."So, if it is serial queue then it can run on current thread and also on other thread but concurrent only on other thread? And sync and async has nothing in common with that?Whether this two pieces of code will behave identically, or there is something more?let queue = DispatchQueue(label: "queue_label") // serial queue
for i in 0..<10 {
queue.sync { // sync
print(i)
}
}let queue = DispatchQueue(label: "queue_label", attributes: .concurrent) // concurrent queue
for i in 0..<10 {
queue.sync(flags: .barrier) { // sync with barrier
print(i)
}
}Thank you! ๐
Post not yet marked as solved
Sorry I forget to reply,It was indeed serial number.Thank you very much! ๐